/* TwinShop. Mobile first: designed at 360–430 px, widened with a centred column. No web fonts. */
:root {
  --ink: #16161a; --muted: #6b6b73; --line: #e6e6ea; --bg: #fff; --surface: #f6f6f7;
  --accent: #16161a; --on-accent: #fff; --ok: #1f7a4d; --warn: #a15c00; --bad: #b42318;
  --r: 14px; --tap: 44px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1 { font-size: 22px; line-height: 1.25; margin: 8px 0; }
h2 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---- public shop ---- */
.shop { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.shop.narrow { max-width: 440px; padding-top: 40px; }
.shop-head { text-align: center; padding: 8px 0 12px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto; }
.avatar.ph { display: grid; place-items: center; background: var(--surface); font-size: 28px; font-weight: 600; }
.shop-head h1 { margin: 8px 0 0; }
.shop-head p { margin: 0; }
.bio { margin-top: 8px !important; white-space: pre-line; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chip { flex: none; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 14px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { display: block; text-decoration: none; }
.ph-img { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.ph-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-img.big { aspect-ratio: 1; }
.card.sold .ph-img img { opacity: .45; }
.badge { position: absolute; left: 8px; top: 8px; background: rgba(22, 22, 26, .85); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.card-name { display: block; margin-top: 6px; font-size: 14px; line-height: 1.3; }
.card-price { display: block; font-weight: 600; font-size: 14px; }
.empty { grid-column: 1 / -1; padding: 24px 0; text-align: center; }
.foot { text-align: center; font-size: 13px; margin-top: 24px; }
.back { display: inline-flex; min-height: var(--tap); align-items: center; text-decoration: none; color: var(--muted); }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.gallery img { flex: none; width: 88%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); scroll-snap-align: center; }
.gallery img:only-child, .gallery .ph-img { width: 100%; flex: none; }
.pname { margin-top: 14px; }
.price { font-size: 20px; font-weight: 700; margin: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--surface); }
.tag.warn { background: #fff4e5; color: var(--warn); }
.desc { white-space: pre-line; }
.box { background: var(--surface); border-radius: var(--r); padding: 12px 14px; }
.steps { padding-left: 20px; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .04em; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 28px; }

/* ---- forms ---- */
.order { display: grid; gap: 12px; margin: 12px 0; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, textarea, select { font: inherit; color: var(--ink); width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
textarea { min-height: 88px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.sizes, .segs { display: flex; flex-wrap: wrap; gap: 8px; }
.size input, .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.size span, .seg span { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.size input:checked + span, .seg input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.size input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.wide { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.err { color: var(--bad); font-size: 14px; margin: 0; }
.ok { color: var(--ok); }
.hp { position: absolute; left: -9999px; }

/* ---- creator app ---- */
.appbar { position: sticky; top: 0; z-index: 2; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.appbar-in { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.switch select { min-height: 36px; padding: 4px 8px; width: auto; }
.app { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(88px + env(safe-area-inset-bottom)); display: grid; gap: 12px; align-content: start; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; text-decoration: none; color: var(--muted); min-height: 56px; }
.tab.on { color: var(--ink); font-weight: 600; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 12px; display: grid; gap: 2px; }
.tile span { font-size: 13px; }
.tile b { font-size: 20px; }
.card-s { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.notice { display: block; background: #fff4e5; color: var(--warn); border-radius: var(--r); padding: 12px 14px; text-decoration: none; font-weight: 600; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; height: 120px; align-items: flex-end; }
.bars li { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bars .bar { width: 100%; max-width: 28px; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars small { font-size: 10px; color: var(--muted); margin-top: 4px; }
.bars .dot { position: absolute; top: 0; font-size: 11px; background: var(--ok); color: #fff; border-radius: 999px; min-width: 18px; text-align: center; }
.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; }
.t th, .t td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.t td:not(:first-child), .t th:not(:first-child) { text-align: right; width: 56px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 64px; }
.thumb { flex: none; width: 48px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.li-main { flex: 1; display: grid; min-width: 0; }
.li-main b, .li-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { flex: none; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--surface); white-space: nowrap; }
.s-sold, .o-cancelled, .o-returned { color: var(--muted); }
.s-reserved, .o-new { background: #fff4e5; color: var(--warn); }
.o-confirmed, .o-making, .o-shipped { background: #eef4ff; color: #1d4ed8; }
.s-active, .o-delivered { background: #e9f6ee; color: var(--ok); }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos .ph { position: relative; width: 84px; height: 105px; border-radius: 10px; overflow: hidden; background: var(--surface); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph.round { width: 84px; height: 84px; border-radius: 50%; }
.photos .ph button { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; }
.photos .add { display: grid; place-items: center; border: 1px dashed var(--muted); color: var(--muted); font-size: 13px; cursor: pointer; text-align: center; }
.photos .add.busy { opacity: .5; }
.items { list-style: none; padding: 0; margin: 8px 0; }
.items li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.sum { margin: 8px 0 0; }
.actions { display: grid; gap: 8px; }
.actions .btn { width: 100%; }
.copy { display: flex; gap: 8px; margin: 4px 0 10px; }
.copy input { font-size: 14px; }
.inline { display: flex; gap: 8px; }
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(4, 1fr); }
}

/* ---- library, twin, try-on ---- */
.lib { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lib li { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--surface); }
.lib li:not(.on) img { opacity: .4; }
.lib form, .lib button, .lib a { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.lib img { width: 100%; height: 100%; object-fit: cover; }
.lib li.on::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; display: grid; place-items: center; pointer-events: none; }
.tag-pose { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(255, 255, 255, .92); padding: 2px 8px; border-radius: 999px; }
.pose-main { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); }
.pick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pick label { flex: none; display: block; position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick img { width: 84px; height: 105px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; }
.pick input:checked + img { border-color: var(--ink); }
.pick input:focus-visible + img { outline: 2px solid var(--ink); outline-offset: 2px; }
.tryon { margin: 0; position: relative; }
.tryon img { width: 100%; border-radius: var(--r); }
.tryon figcaption { position: absolute; left: 10px; top: 10px; background: rgba(22, 22, 26, .85); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.notice-soft { background: var(--surface); border-radius: var(--r); padding: 10px 12px; font-size: 14px; margin: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 12px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.check { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; color: var(--ink); }
.check input { width: 22px; min-height: 22px; height: 22px; flex: none; }
.offer { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.offer img { width: 56px; height: 70px; object-fit: cover; border-radius: 8px; flex: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.twin-box { background: var(--ink); color: #fff; border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.twin-box label { color: #fff; font-weight: 600; }
.twin-box input { border-color: transparent; }
.twin-box .btn { background: #fff; color: var(--ink); border-color: #fff; }
.said { font-style: italic; color: var(--muted); margin: 0; }

/* privacy, terms, data deletion */
.legal h2 { font-size: 16px; margin: 24px 0 6px; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 18px; }
.legal code { font-size: 12px; background: var(--line, #eee); padding: 1px 4px; border-radius: 4px; }
.legal-links { margin-top: 28px; }

/* bank transfer (VietQR) */
.pay { margin: 20px 0; text-align: center; }
.pay h2 { font-size: 16px; margin: 0 0 10px; }
.pay .qr { width: min(260px, 72vw); margin: 0 auto; border: 1px solid var(--line, #e5e5e5); border-radius: 12px; overflow: hidden; background: #fff; }
.pay .qr svg { display: block; width: 100%; height: auto; }
.bank { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; text-align: left; margin: 14px 0 8px; font-size: 14px; }
.bank dt { color: var(--muted); align-self: center; }
.bank dd { margin: 0; overflow-wrap: anywhere; align-self: center; }
.bank .copy { display: flex; gap: 6px; align-items: center; }
.bank .copy input { flex: 1; min-width: 0; font: inherit; font-weight: 600; border: 0; background: transparent; padding: 0; }
.bank-set { border: 1px solid var(--line, #e5e5e5); border-radius: 12px; padding: 10px 14px 12px; margin: 4px 0 12px; display: grid; gap: 10px; }
.bank-set legend { font-weight: 600; padding: 0 4px; }
.pay-choice legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.pay-choice .segs { display: grid; gap: 8px; }
.pay-choice .seg { position: relative; display: block; }
.pay-choice .seg span { display: flex; justify-content: flex-start; width: 100%; }
.pay-state form { margin-top: 8px; }

/* ---- shop look (src/looks.ts) and the "Về mình" page ---- */
.shop h1, .about h1 { font-family: var(--serif, inherit); }
.cover { width: 100%; height: 200px; object-fit: cover; object-position: center 22%; border-radius: var(--r); margin-bottom: 4px; background: var(--surface); }
.about p { margin: 0 0 12px; }
.quotes { list-style: none; padding: 0; margin: 16px 0; }
.quotes li { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.quotes blockquote { margin: 0; font-style: italic; }

/* ---- admin radar ---- */
.cands { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cands a { text-decoration: none; display: block; }
.score { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 14px; }
.about .lead { font-size: 17px; }
.about h2 { margin: 20px 0 6px; font-family: var(--serif, inherit); }
.values { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.values li { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface); border-radius: var(--r); }
.copy textarea { flex: 1; font-size: 14px; font-family: inherit; }

/* ---- personal page (shops.mode = 'profile') and the "made with" link ---- */
.links { display: grid; gap: 8px; margin: 4px 0 16px; }
.story { text-align: center; margin: 0 0 16px; }
.story p { margin: 0 0 4px; }
.gallery { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--surface); }
.sec { font-size: 17px; margin: 8px 0 4px; font-family: var(--serif, inherit); }
.made { text-align: center; font-size: 13px; margin: 24px 0 0; }
.made a { color: var(--muted); }
.modes { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; display: grid; gap: 6px; }
.modes label { display: block; }
.lib li { position: relative; }
.lib .star { position: absolute; right: 4px; top: 4px; width: auto; height: auto; }
.lib .star button { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #16161a; font-size: 18px; line-height: 34px; text-align: center; }

/* ---- home page (gemtwin.app/) ---- */
.home { max-width: 1040px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.home-nav { display: flex; justify-content: space-between; align-items: center; min-height: 56px; }
.home-nav .logo { font-size: 18px; letter-spacing: -0.01em; }
.home-nav a { text-decoration: none; color: var(--muted); }
.home h1 { font-size: clamp(28px, 6vw, 46px); line-height: 1.12; letter-spacing: -0.02em; margin: 16px 0 12px; }
.home .lead { font-size: 18px; color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.home .btn { display: inline-flex; min-height: 48px; padding: 0 22px; align-items: center; }
.hero { display: grid; gap: 32px; align-items: center; padding: 24px 0 40px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.2fr 1fr; padding-top: 56px; } }
.phone { justify-self: center; width: 250px; aspect-ratio: 9 / 18.5; border: 10px solid #16161a; border-radius: 36px; background: #fffaf7; padding: 12px; display: grid; gap: 8px; align-content: start; box-shadow: 0 24px 60px rgba(22, 22, 26, .16); }
.ph-cover { height: 72px; border-radius: 12px; background: linear-gradient(135deg, #f3d9cf, #e7c9a9 60%, #c8a27a); }
.ph-avatar { width: 44px; height: 44px; border-radius: 50%; margin: -30px auto 0; border: 3px solid #fffaf7; background: #d9b8a0; }
.ph-line { height: 8px; border-radius: 4px; background: #eadfd8; justify-self: center; }
.ph-line.w60 { width: 60%; } .ph-line.w40 { width: 40%; }
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.ph-tile { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; }
.ph-tile i { position: absolute; left: 4px; bottom: 4px; font-size: 8px; font-style: normal; background: rgba(22, 22, 26, .75); color: #fff; padding: 1px 5px; border-radius: 999px; }
.t1 { background: linear-gradient(160deg, #f6e1d6, #e3b9a3); } .t2 { background: linear-gradient(160deg, #e6eef6, #b9cde3); }
.t3 { background: linear-gradient(160deg, #f3ecd9, #d8c39a); } .t4 { background: linear-gradient(160deg, #eadfe9, #c7b0c9); }
.ph-btn { margin-top: 4px; text-align: center; font-size: 12px; font-weight: 600; padding: 8px; border-radius: 10px; background: #16161a; color: #fff; }
.steps3, .kinds { display: grid; gap: 12px; margin: 8px 0 32px; }
@media (min-width: 760px) { .steps3 { grid-template-columns: repeat(3, 1fr); } .kinds { grid-template-columns: 1fr 1fr; } }
.steps3 > div, .kinds > div { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.steps3 b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; }
.steps3 h2, .kinds h2 { font-size: 17px; margin: 10px 0 4px; }
.steps3 p, .kinds p { margin: 0; color: var(--muted); }
.promise { background: var(--surface); border-radius: var(--r); padding: 20px 18px; margin: 0 0 32px; }
.promise h2 { font-size: 20px; margin: 0 0 8px; }
.promise ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.cta-end { text-align: center; margin: 8px 0 24px; }
.home-foot { text-align: center; }
