:root {
  --pink: #EC0B7F; --pink-d: #C80069; --pink-l: #FDE6F1;
  --teal: #2CCFB0; --teal-d: #0E8A73; --teal-l: #E2F8F3;
  --ink: #1F1A24; --muted: #6E6875; --line: #ECE7EE; --bg: #FAF8FA; --card: #fff;
  --ok: #138A5C; --warn: #B76E00; --bad: #C8323A;
  --r: 16px; --nav: 64px; --top: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 Montserrat, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* top & bottom bars */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); padding: 0 8px 0 14px; padding-top: env(safe-area-inset-top); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; flex: 1; font-weight: 700; font-size: 17px; color: var(--pink); }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.icon-btn { position: relative; border: 0; background: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink); }
.icon-btn:active { background: var(--bg); }
.badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
nav.bottom a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 500; }
nav.bottom a.on { color: var(--pink); }
nav.bottom a.on svg { stroke-width: 2.2; }
nav.bottom .badge { top: 6px; right: calc(50% - 22px); }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(var(--nav) + 28px); min-height: calc(100vh - var(--top)); }
@media (min-width: 900px) { main { max-width: 980px; } }

/* type */
h1 { font-size: 22px; line-height: 1.25; margin: 4px 0 8px; }
h2 { font-size: 17px; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 a { font-size: 13px; font-weight: 600; color: var(--pink); }
h3 { font-size: 15px; margin: 0 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.pre { white-space: pre-line; }
.center { text-align: center; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; font-size: 15px; cursor: pointer; background: var(--pink); color: #fff; transition: transform .08s, opacity .15s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { display: flex; width: 100%; }
.btn.teal { background: var(--teal); color: #08372E; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.soft { background: var(--pink-l); color: var(--pink-d); }
.btn.danger { background: #fff; color: var(--bad); border: 1.5px solid #F2D0D2; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
label.f > span i { color: var(--pink); font-style: normal; }
input.i, textarea.i, select.i { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; outline: none; }
input.i:focus, textarea.i:focus, select.i:focus { border-color: var(--pink); }
textarea.i { min-height: 96px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 8px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); flex: none; margin-top: 1px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card { margin-top: 12px; }
.banner { border-radius: var(--r); overflow: hidden; aspect-ratio: 16/7; background: #eee center/cover; margin-bottom: 4px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 10px 6px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { background: var(--pink); color: #fff; }
.tabs.teal button.on { background: var(--teal); color: #08372E; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 520px) { .cats { grid-template-columns: repeat(4, 1fr); } }
.cat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px 8px; text-align: center; font-size: 11px; font-weight: 600; line-height: 1.25; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 86px; }
.cat .e { font-size: 26px; line-height: 1.2; }
.cat small { color: var(--muted); font-weight: 500; }

.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.tile .ph { aspect-ratio: 1; background: var(--pink-l) center/cover; display: grid; place-items: center; font-size: 34px; }
.tile .ph.wide { aspect-ratio: 4/3; }
.tile .tx { padding: 8px 10px 10px; display: grid; gap: 2px; }
.tile .nm { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .pr { font-weight: 700; color: var(--pink); }
.tile .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list-item { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 8px; }
.list-item .av { width: 56px; height: 56px; border-radius: 12px; background: var(--pink-l) center/cover; flex: none; display: grid; place-items: center; font-size: 24px; }
.list-item .av.round { border-radius: 50%; }
.list-item .tx { flex: 1; min-width: 0; }
.list-item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item.unread { border-color: var(--pink); background: #FFF8FB; }
.stars { color: #F5A623; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.stars .n { color: var(--muted); letter-spacing: 0; margin-left: 4px; }

/* detail pages */
.hero { margin: -14px -16px 0; aspect-ratio: 16/9; background: var(--pink-l) center/cover; display: grid; place-items: center; font-size: 60px; position: relative; }
@media (min-width: 760px) { .hero { margin: 0 0 4px; border-radius: var(--r); } }
.hero .fav { position: absolute; right: 12px; top: 12px; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.round-btn.on svg { fill: var(--pink); stroke: var(--pink); }
.head { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: -26px; position: relative; }
@media (min-width: 760px) { .head { margin-top: 10px; } }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--teal-l); color: var(--teal-d); }
.tag.pink { background: var(--pink-l); color: var(--pink-d); }
.tag.warn { background: #FFF2DC; color: var(--warn); }
.tag.ok { background: #E1F5EC; color: var(--ok); }
.tag.bad { background: #FBE4E5; color: var(--bad); }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }
.actions .btn { padding: 10px 6px; font-size: 13px; flex-direction: column; gap: 3px; }
.notice { border-radius: var(--r); padding: 14px 16px; background: #FFF6E5; border: 1px solid #F8E0B5; margin: 12px 0; }
.notice.pink { background: var(--pink-l); border-color: #F7C6DE; }
.notice.teal { background: var(--teal-l); border-color: #BDEDE2; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.progress { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--pink)); border-radius: 99px; }
.map { height: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin: 10px 0; z-index: 0; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; margin: -14px -16px 0; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery div { scroll-snap-align: start; aspect-ratio: 1; background: var(--pink-l) center/cover; }
@media (min-width: 760px) { .gallery { margin: 0; border-radius: var(--r); grid-auto-columns: 60%; gap: 8px; } }
.dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty button { width: 38px; height: 38px; border: 0; background: none; font-size: 20px; cursor: pointer; }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }
.sum { display: grid; gap: 6px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; }
.sum .tot { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.review { border-top: 1px solid var(--line); padding: 12px 0; }
.review:first-child { border-top: 0; }
.starpick { display: flex; gap: 4px; font-size: 32px; margin: 4px 0 8px; }
.starpick button { border: 0; background: none; cursor: pointer; color: #DDD6E0; padding: 0; line-height: 1; }
.starpick button.on { color: #F5A623; }
.pics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pics .pic { aspect-ratio: 1; border-radius: 10px; background: var(--bg) center/cover; border: 1.5px dashed var(--line); position: relative; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 24px; }
.pics .pic.has { border-style: solid; }
.pics .pic .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; border: 0; font-size: 13px; line-height: 22px; cursor: pointer; }
.imgpick { width: 120px; height: 120px; border-radius: 16px; background: var(--bg) center/cover; border: 1.5px dashed var(--line); display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 13px; text-align: center; margin-bottom: 12px; }
.avatar-pick { border-radius: 50%; width: 96px; height: 96px; }

/* chat */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--top) - var(--nav) - 30px); height: calc(100dvh - var(--top) - var(--nav) - 30px); }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 12px 2px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.msg.me { align-self: flex-end; background: var(--pink); color: #fff; border-color: var(--pink); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg img { border-radius: 10px; max-height: 260px; }
.msg time { display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; text-align: right; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; }
.composer textarea { flex: 1; min-height: 44px; max-height: 120px; border-radius: 22px; padding: 11px 16px; }
.composer .round-btn { flex: none; box-shadow: none; border: 1.5px solid var(--line); }
.composer .send { background: var(--pink); border-color: var(--pink); color: #fff; }

/* sheet & toast */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,10,25,.45); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: up .2s ease; max-width: 640px; margin: 0 auto; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: 18px; margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 18px); transform: translateX(-50%) translateY(10px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 60; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .e { font-size: 44px; margin-bottom: 6px; }
.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.landing { text-align: center; padding: 10px 0 0; }
.landing img.logo { width: 120px; margin: 0 auto 6px; }
.role { display: flex; gap: 12px; align-items: center; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; width: 100%; }
.role .e { font-size: 30px; width: 48px; height: 48px; border-radius: 14px; background: var(--pink-l); display: grid; place-items: center; flex: none; }
.role.teal .e { background: var(--teal-l); }
.role b { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; cursor: pointer; font-weight: 500; }
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu svg { width: 20px; height: 20px; color: var(--muted); }
.menu .grow { flex: 1; }
.menu .badge { position: static; }
.terms { max-height: 46vh; overflow-y: auto; font-size: 13px; white-space: pre-line; background: var(--bg); border-radius: 12px; padding: 12px; }

/* feel like a native app */
html, body { overscroll-behavior-y: none; }
button, a, nav, .tabs, .chip, .btn, label { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
img { -webkit-user-drag: none; }
.is-app body { -webkit-touch-callout: none; }
