@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;1,500&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --bg: #17050d; --panel: #260b18; --panel-2: #331222; --line: rgba(226, 184, 102, .22);
  --gold: #e2b866; --gold-2: #f4dca6; --ivory: #f7eddd; --muted: #cbb3a9; --rose: #c4506d; --ok: #7fd1a3;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Outfit', system-ui, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: #0d0308; color: var(--ivory); font: 300 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
.shell { max-width: 480px; min-height: 100%; margin: 0 auto; background: radial-gradient(700px 420px at 80% -5%, #4a1528 0%, var(--bg) 62%); position: relative; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.3rem; }
em { color: var(--gold); font-style: italic; }
a { color: var(--gold); text-decoration: none; }
.muted { color: var(--muted); }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(23, 5, 13, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); min-height: 58px; }
.logo { font: 600 1.55rem var(--serif); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo span { color: var(--gold); font-style: italic; }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ivory); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon svg { width: 20px; height: 20px; }
.pillbtn { border: 1px solid var(--gold); background: transparent; color: var(--gold-2); font: 500 .82rem var(--sans); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.offline { background: var(--rose); color: #fff; font-size: .84rem; padding: 6px 16px; text-align: center; }

main { flex: 1; padding: 16px 16px calc(96px + var(--safe-b)); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(23, 5, 13, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 10; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 9px; color: var(--muted); font-size: .72rem; font-weight: 400; letter-spacing: .04em; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--gold); }

input, select { width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--ivory); border-radius: 14px; padding: 12px 13px; font: 400 16px var(--sans); min-height: 48px; }
select option { background: var(--panel); }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-top: 10px; }

.hero { margin: 6px 0 16px; }
.hero p { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 4px; padding: 0 16px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 8px 15px; border-radius: 999px; font: 400 .86rem var(--sans); cursor: pointer; }
.chip.on { background: var(--gold); color: #2a0d12; border-color: var(--gold); font-weight: 500; }
.count { font-size: .82rem; color: var(--muted); margin: 10px 0; }

.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 16px; color: inherit; position: relative; }
.art { height: 170px; display: grid; place-items: center; background-size: cover; background-position: center; position: relative; }
.art svg { width: 96px; opacity: .5; stroke: #fff; stroke-width: 2; }
.badge { position: absolute; top: 12px; left: 12px; background: var(--gold); color: #2a0d12; font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.badge.demo { top: auto; bottom: 12px; background: rgba(0, 0, 0, .55); color: var(--ivory); font-weight: 400; }
.heart { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.heart svg { width: 20px; height: 20px; }
.heart.on { color: var(--rose); } .heart.on svg { fill: var(--rose); }
.card .body { padding: 14px 16px 16px; }
.meta { font-size: .85rem; color: var(--muted); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; }
.price { font: 500 1.15rem var(--sans); color: var(--gold-2); }
.price small { font-weight: 300; font-size: .76rem; color: var(--muted); }
.ok { color: var(--ok); }
.empty { padding: 44px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }

/* detail */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: -16px -16px 0; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery .art { flex: none; width: 100%; height: 250px; scroll-snap-align: start; }
.detail { padding-top: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tag { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; color: var(--muted); }
.actions { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); background: rgba(23, 5, 13, .95); backdrop-filter: blur(12px); border-top: 1px solid var(--line); z-index: 11; }
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--gold); background: linear-gradient(180deg, #f1d190, #d3a652); color: #2a0d12; font: 500 1rem var(--sans); padding: 13px 16px; border-radius: 999px; cursor: pointer; min-height: 50px; }
.btn.ghost { flex: none; background: transparent; color: var(--gold-2); padding-inline: 18px; }
.btn:disabled { opacity: .5; }

/* bottom sheet */
dialog { border: 0; border-top: 1px solid var(--line); background: var(--panel); color: var(--ivory); border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + var(--safe-b)); width: min(480px, 100%); max-width: none; margin: auto auto 0; max-height: 90vh; }
dialog::backdrop { background: rgba(10, 2, 6, .7); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 12px; margin-top: 14px; }
.note { font-size: .88rem; padding: 10px 14px; border-radius: 12px; }
.note.ok { background: rgba(127, 209, 163, .12); border: 1px solid rgba(127, 209, 163, .35); }
.note.bad { background: rgba(196, 80, 109, .14); color: #f0a3b6; border: 1px solid rgba(196, 80, 109, .4); }

.req { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; display: block; color: inherit; }
#toast { position: fixed; bottom: calc(90px + var(--safe-b)); left: 50%; transform: translate(-50%, 120px); background: var(--gold); color: #2a0d12; padding: 11px 20px; border-radius: 999px; font-weight: 500; font-size: .92rem; transition: transform .3s; z-index: 50; white-space: nowrap; }
#toast.show { transform: translate(-50%, 0); }
