/* Chuyền Tay v2 — giao diện
   Ý tưởng: giấy ngà của thư viện, mực chàm, vàng nghệ (lấy cảm hứng từ theme khách chọn) + ảnh thật đặt trong khung vòm cửa sổ.
   Giữ bố cục, thẻ treo đồ và con dấu "ĐÃ TẶNG" của bản v1; đổi sang nét mảnh, font có chân trang trọng. */
:root {
  color-scheme: light;
  --paper: #F5F1E8;
  --paper-2: #ECE5D6;
  --paper-3: #E2D8C3;
  --white: #FFFDF8;
  --ink: #1E2A52;
  --ink-2: #4B5784;
  --ink-3: #868BA4;
  --line: #DDD4C1;
  --line-2: #C9BEA6;
  --ochre: #B06C18;
  --ochre-2: #8F5612;
  --ochre-tint: #F5E6CB;
  --sage: #47704F;
  --sage-tint: #DDE9DA;
  --blue: #34569A;
  --blue-tint: #DFE6F4;
  /* tên biến cũ (admin.css dùng chung) */
  --pen: #2F4A8A;
  --pen-2: #22386C;
  --pen-tint: #E3E8F4;
  --hl: #E9C77F;
  --hl-tint: #F7ECD5;
  --mint: #8DB596;
  --mint-tint: #DEEBDB;
  --stamp: #B03A2E;
  --stamp-tint: #F5DFDA;
  --amber: #C98A2B;

  --f-display: 'CT Source Serif', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --f-body: 'CT Inter', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display-scale: 1;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --bw: 1px;
  --sh: 0 1px 2px rgba(58, 44, 18, .06), 0 10px 28px -14px rgba(58, 44, 18, .28);
  --sh-sm: 0 1px 2px rgba(58, 44, 18, .08), 0 4px 12px -6px rgba(58, 44, 18, .2);
  --wrap: 1220px;
  --top: 70px;
}
html[data-font="lora"] { --f-display: 'CT Lora', Lora, Georgia, serif; --f-body: 'CT Be Vietnam Pro', 'Be Vietnam Pro', system-ui, sans-serif; }
html[data-font="noto"] { --f-display: 'CT Noto Serif', 'Noto Serif', Georgia, serif; --f-body: 'CT Noto Sans', 'Noto Sans', system-ui, sans-serif; }
html[data-font="garamond"] { --f-display: 'CT EB Garamond', 'EB Garamond', Garamond, Georgia, serif; --f-body: 'CT Inter', Inter, system-ui, sans-serif; --display-scale: 1.1; }
[data-font-sample="source"] { font-family: 'CT Source Serif', Georgia, serif; }
[data-font-sample="lora"] { font-family: 'CT Lora', Georgia, serif; }
[data-font-sample="noto"] { font-family: 'CT Noto Serif', Georgia, serif; }
[data-font-sample="garamond"] { font-family: 'CT EB Garamond', Georgia, serif; font-size: 1.12em; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--pen); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.005em; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--ochre); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--white); color: var(--ink);
  font-weight: 600; font-size: 14.5px; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #121B3C; border-color: #121B3C; }
.btn-hl { background: var(--hl-tint); border-color: var(--hl); }
.btn-mint { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn-danger { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--paper-2); border-color: transparent; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--pen); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.link:hover { text-decoration: underline; }
.link[disabled] { color: var(--ink-3); cursor: default; text-decoration: none; }
.link.danger { color: var(--stamp); }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn .ico { width: 21px; height: 21px; }
.dot {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--stamp); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--paper);
}

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.topbar.is-scrolled { border-color: var(--line); box-shadow: 0 6px 20px -16px rgba(58, 44, 18, .5); }
.topbar .wrap { height: 100%; display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; flex: none; }
.logo svg { width: 34px; height: 34px; }
.logo b { font: 600 calc(23px * var(--display-scale))/1 var(--f-display); letter-spacing: -0.01em; display: block; }
.logo small { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 500; margin-top: 3px; }
.tsearch { flex: 1; max-width: 520px; position: relative; }
.search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 5px 0 14px;
  background: var(--white); border: 1px solid var(--line-2); border-radius: 12px;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(176, 108, 24, .14); }
.search .ico { color: var(--ink-2); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; height: 100%; }
.search button { height: 34px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 13px; }
.tact { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tact .btn-primary { margin-right: 6px; }
.me-btn { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); margin-left: 4px; }
.me-btn:hover { border-color: var(--ink); }
.me-btn span.n { font-weight: 600; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 6px; z-index: 60;
}
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; text-align: left; font-size: 14.5px; }
.menu a:hover, .menu button:hover { background: var(--paper); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- Dải thông báo ---------- */
.banner { background: var(--hl-tint); border-bottom: 1px solid var(--line); }
.banner .wrap { display: flex; gap: 12px; align-items: center; padding-top: 9px; padding-bottom: 9px; font-size: 14px; color: var(--ink); }
.banner .wrap > .ico { width: 19px; height: 19px; color: var(--ochre); }
.banner a { color: var(--ink); font-weight: 700; text-decoration: underline; }
.banner.ann { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.banner.ann .wrap { color: var(--paper); }
.banner.ann .wrap > .ico { color: var(--hl); }
.banner.ann.warning { background: var(--hl-tint); border-color: var(--line); }
.banner.ann.warning .wrap { color: var(--ink); }
.banner.ann.warning .wrap > .ico { color: var(--ochre); }
.banner.ann.success { background: var(--sage-tint); border-color: var(--line); }
.banner.ann.success .wrap { color: var(--ink); }
.banner.ann.success .wrap > .ico { color: var(--sage); }
.banner.ann .wrap > span { flex: 1; }
.banner .ann-x { width: 32px; height: 32px; flex: none; color: inherit; }
.banner .ann-x:hover { background: rgba(255, 255, 255, .12); }
.banner .ann-x .ico { width: 18px; height: 18px; }

/* ---------- Avatar / chip ---------- */
.av {
  --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; position: relative; overflow: hidden;
  background: var(--ochre-tint); border: 1px solid var(--line-2); display: inline-grid; place-items: center;
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-i { font: 600 calc(var(--s) * .38)/1 var(--f-display); color: var(--ochre-2); }
.vb { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); font-size: 13px; font-weight: 600; color: var(--ink);
}
.cond { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.cond::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.cond-moi::before { background: var(--blue); }
.cond-sua::before { background: var(--amber); }
.status {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px;
  font-weight: 600; font-size: 12.5px; border: 1px solid var(--line-2); background: var(--white); white-space: nowrap;
}
.status.available { background: var(--sage-tint); border-color: #B7CDB3; color: #2F5537; }
.status.available::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px rgba(71, 112, 79, .18); }
.status.reserved { background: var(--hl-tint); border-color: var(--hl); color: var(--ochre-2); }
.status.given, .status.exchanged, .status.sold { background: var(--stamp-tint); color: var(--stamp); border-color: #E2B3AC; }
.status.hidden { background: var(--paper-2); color: var(--ink-2); }

/* Thẻ treo (hang-tag) — điểm nhấn kế thừa từ bản v1 */
.hangtag {
  white-space: nowrap;
  position: absolute; top: 12px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px 0 24px; font-weight: 600; font-size: 12.5px; color: #fff;
  background: var(--sage); border-radius: 4px 10px 10px 4px; transform: rotate(-3deg);
  box-shadow: 0 2px 6px rgba(30, 42, 82, .25);
}
.hangtag::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.hangtag.doi { background: var(--blue); }
.hangtag.ban { background: var(--ochre); }
.hangtag .ico { width: 14px; height: 14px; }
.hangtag.inline { position: relative; top: auto; left: auto; transform: rotate(-2deg); box-shadow: none; vertical-align: middle; }

.stamp {
  position: absolute; left: 50%; top: 46%; z-index: 3;
  transform: translate(-50%, -50%) rotate(-11deg);
  font: 700 21px/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--stamp); padding: 9px 16px 8px; border: 3px solid var(--stamp); border-radius: 8px;
  background: rgba(255, 253, 248, .86); box-shadow: inset 0 0 0 2px rgba(176, 58, 46, .3);
}
.stamp.big { font-size: 32px; padding: 12px 22px 11px; border-width: 4px; }
.stamp.anim { animation: stampIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampIn { from { opacity: 0; transform: translate(-50%, -50%) rotate(-11deg) scale(2.2); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-11deg) scale(1); } }
.ribbon {
  position: absolute; right: 10px; top: 12px; z-index: 2; height: 26px; padding: 0 10px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.ribbon.danger { background: var(--stamp); }
.pin-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; height: 24px; padding: 0 9px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
}
.pin-badge .ico { width: 13px; height: 13px; }

/* ---------- Trang chủ: hero ---------- */
.hero { position: relative; overflow: hidden; padding: 38px 0 30px; }
.hero::before { /* đường kẻ lề như trang sổ */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line);
}
.hero-in { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-kicker { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--ochre-2); margin-bottom: 22px; }
.hero-kicker::before { content: ""; width: 36px; height: 1.5px; background: var(--ochre); }
.hero h1 {
  font-size: calc(clamp(40px, 5.2vw, 72px) * var(--display-scale)); line-height: 1.02; letter-spacing: -0.02em; font-weight: 600;
  max-width: 12ch; text-wrap: balance;
}
.hero .lead { font-size: 17.5px; color: var(--ink-2); max-width: 46ch; margin-top: 22px; line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 40px; margin: 38px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { margin: 0; font: 600 calc(36px * var(--display-scale))/1.05 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }

.hero-art { position: relative; margin: 0; height: 580px; }
.arch {
  position: absolute; right: 4%; top: 0; width: 62%; height: 100%;
  border-radius: 999px 999px 16px 16px; overflow: hidden;
  background: linear-gradient(180deg, #CDBB97, #8C7A5B);
  box-shadow: 0 30px 60px -30px rgba(30, 42, 82, .55);
}
.arch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 6px rgba(255, 253, 248, .55); pointer-events: none; }
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 70%; }
.snap {
  position: absolute; left: 2%; bottom: 40px; width: 40%; z-index: 2; padding: 10px 10px 0; background: var(--white);
  border-radius: 4px; transform: rotate(-5deg); box-shadow: 0 18px 40px -18px rgba(30, 42, 82, .55);
}
.snap img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; background: var(--paper-2); }
.snap span { display: block; padding: 10px 2px 12px; font: italic 500 15px/1.3 var(--f-display); color: var(--ink-2); text-align: center; }
.hero-art .pin {
  position: absolute; left: 6%; top: 34px; z-index: 3; display: flex; gap: 10px; align-items: center; width: 250px; padding: 8px 12px 8px 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none !important;
  box-shadow: var(--sh); transform: rotate(2deg); transition: transform .25s;
}
.hero-art .pin:hover { transform: rotate(0) translateY(-3px); }
.hero-art .pin img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex: none; }
.hero-art .pin small { display: block; font-size: 11.5px; color: var(--ochre-2); font-weight: 600; }
.hero-art .pin b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.3; }
.pin-price b { font: 600 15px var(--f-display); color: var(--ochre-2); -webkit-line-clamp: 1 !important; }
.pin-price.tang b { color: var(--sage); }
.pin-price.doi { font-size: 12px; color: var(--ink-2); }
.pin-price.doi b { display: inline; font: 500 12px var(--f-body); color: var(--ink); }
.hero-art figcaption { position: absolute; right: 4%; bottom: -24px; font-size: 11.5px; color: var(--ink-3); }

/* Chuỗi chuyển động khi tải trang chủ (một khoảnh khắc duy nhất) */
.js .hero-txt > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.js .hero-txt > :nth-child(2) { animation-delay: .08s; }
.js .hero-txt > :nth-child(3) { animation-delay: .16s; }
.js .hero-txt > :nth-child(4) { animation-delay: .24s; }
.js .hero-txt > :nth-child(5) { animation-delay: .32s; }
.js .arch { animation: archIn 1.2s cubic-bezier(.65, 0, .25, 1) .1s both; }
.js .arch img { animation: kenburns 22s ease-in-out 1.2s infinite alternate; }
.js .snap { animation: dropIn .9s cubic-bezier(.2, .9, .3, 1.2) .7s both; }
.js .hero-art .pin:not([hidden]) { animation: fadeIn .6s ease 1.1s both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes archIn { from { clip-path: inset(100% 0 0 0 round 999px 999px 16px 16px); } to { clip-path: inset(0 0 0 0 round 999px 999px 16px 16px); } }
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.14) translate(-2%, -1%); } }
@keyframes dropIn { from { opacity: 0; transform: rotate(-12deg) translateY(30px); } to { opacity: 1; transform: rotate(-5deg); } }

/* ---------- Danh mục ---------- */
.cats { padding-top: 26px; }
.cat-rail { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 10px; }
@media (max-width: 860px) { .cat-rail { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; } }
.cat {
  flex: none; scroll-snap-align: start; display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px 0 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 500; font-size: 14px; color: var(--ink);
  transition: background .15s, border-color .15s;
}
.cat i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ochre-2); }
.cat i .ico { width: 17px; height: 17px; }
.cat:hover { border-color: var(--line-2); background: #FFFBF2; }
.cat.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cat.on i { background: rgba(255, 255, 255, .12); color: var(--hl); }

/* ---------- Duyệt tin ---------- */
.browse { display: grid; grid-template-columns: 250px 1fr; gap: 34px; padding-top: 18px; padding-bottom: 80px; align-items: start; }
.side { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 16px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.filters summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font: 600 calc(18px * var(--display-scale)) var(--f-display); }
.filters summary::-webkit-details-marker { display: none; }
.filters summary .cnt { margin-left: auto; font: 600 12px var(--f-body); background: var(--ochre); color: #fff; border-radius: 999px; padding: 2px 8px; }
.fl { display: grid; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.select, .input, .textarea {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--white);
  color: var(--ink); font-size: 15px; font-weight: 400; outline: 0; transition: border-color .12s, box-shadow .12s;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(176, 108, 24, .14); }
.input:disabled { background: var(--paper); }
.textarea { height: auto; min-height: 120px; padding: 12px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231E2A52' stroke-width='1.8'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--white); }
.seg button { border: 0; background: transparent; height: 38px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--ink); background: var(--paper); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button .ico { width: 15px; height: 15px; }
.seg.small button { height: 32px; font-size: 12.5px; padding: 0 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: 13px; font-weight: 500; color: var(--ink); text-align: left; }
.pill:hover { border-color: var(--ink-3); }
.pill.on { background: var(--ochre-tint); border-color: var(--ochre); color: var(--ochre-2); }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; font-weight: 500; cursor: pointer; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--paper-3); position: relative; border: 0; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.switch input:checked { background: var(--sage); }
.switch input:checked::after { left: 19px; }
.switch:has(> span) { align-items: flex-start; }
.switch:has(> span) input { margin-top: 1px; }
.rules-mini { padding: 0; overflow: hidden; }
.rm-ph { height: 92px; background: var(--paper-3) center 40% / cover no-repeat; }
.rm-b { padding: 14px 16px 16px; }
.rules-mini h4 { font-size: calc(17px * var(--display-scale)); }
.rules-mini ul { list-style: none; padding: 0; margin: 10px 0 12px; display: grid; gap: 8px; font-size: 13.5px; }
.rules-mini li { display: flex; gap: 8px; align-items: flex-start; }
.rules-mini li .ico { color: var(--ochre); margin-top: 2px; }

.res-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 16px; margin-bottom: 18px; flex-wrap: wrap; }
.res-h h2 { font-size: calc(30px * var(--display-scale)); letter-spacing: -0.01em; }
.res-h h2 small { font: 500 14px var(--f-body); color: var(--ink-2); margin-left: 10px; letter-spacing: 0; }
.res-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.res-h .select { width: auto; height: 40px; font-size: 14px; }
.mode-seg button { height: 40px; }
.m-search { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  color: var(--ink); text-decoration: none !important; transition: border-color .18s, box-shadow .18s, transform .18s;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--sh); transform: translateY(-2px); }
.card-ph { position: relative; aspect-ratio: 1; background: var(--paper-2); overflow: hidden; }
.card-ph > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-ph > img { transform: scale(1.04); }
.card.is-done .card-ph > img { filter: grayscale(.85) sepia(.15); opacity: .72; }
.card-b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font: 600 15.5px/1.3 var(--f-body); letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.card-price b { font: 600 calc(19px * var(--display-scale))/1.2 var(--f-display); color: var(--ochre-2); font-variant-numeric: tabular-nums; }
.card-price span { font-size: 12px; color: var(--ink-2); }
.card-price.tang b { color: var(--sage); }
.card-price.doi { display: block; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 26px; }
.card-price.doi b { font: 600 13px var(--f-body); color: var(--blue); }
.card-loc { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-f { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--paper-2); font-size: 12.5px; }
.card-f .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-f .t { margin-left: auto; color: var(--ink-3); white-space: nowrap; }
.req-count { position: absolute; right: 10px; bottom: 10px; z-index: 2; height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(255, 253, 248, .94); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; color: var(--ink); }
.req-count .ico { width: 13px; height: 13px; color: var(--ochre); }

.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--white); }
.empty h3 { font-size: calc(23px * var(--display-scale)); }
.empty p { color: var(--ink-2); margin: 8px auto 18px; max-width: 44ch; }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--paper-2), var(--white), var(--paper-2)); background-size: 200% 100%; animation: sk 1.2s infinite; aspect-ratio: .74; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Dải ảnh "Một món đồ được chuyền tay thế nào" ---------- */
.band { position: relative; overflow: hidden; color: var(--paper); isolation: isolate; }
.band-bg { position: absolute; inset: -12% 0; z-index: -2; background: #2B3150 center / cover no-repeat; transform: scale(1.12); will-change: transform; }
.band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(20, 27, 56, .93) 0%, rgba(20, 27, 56, .82) 50%, rgba(20, 27, 56, .55) 100%); }
.band-in { padding-top: 84px; padding-bottom: 84px; }
.band-h { max-width: 640px; }
.band h2 { font-size: calc(clamp(30px, 3.6vw, 46px) * var(--display-scale)); color: #FFF8EA; letter-spacing: -0.015em; }
.band-h p { margin-top: 12px; color: rgba(245, 241, 232, .82); font-size: 16.5px; }
.steps4 { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; }
.steps4 li { counter-increment: s; position: relative; padding-top: 18px; border-top: 1px solid rgba(233, 199, 127, .45); color: rgba(245, 241, 232, .82); font-size: 14.5px; line-height: 1.55; }
.steps4 li::before { content: counter(s); display: block; font: 500 calc(44px * var(--display-scale))/1 var(--f-display); color: var(--hl); margin-bottom: 12px; }
.steps4 b { display: block; color: #FFF8EA; font-size: 16px; margin-bottom: 6px; }
.modes3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
.mode-tile { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: left; padding: 16px 18px; border-radius: 14px;
  background: rgba(255, 253, 248, .08); border: 1px solid rgba(255, 253, 248, .2); color: var(--paper); backdrop-filter: blur(4px); transition: background .15s, border-color .15s; }
button.mode-tile:hover { background: rgba(255, 253, 248, .16); border-color: rgba(255, 253, 248, .4); }
.mode-tile .ico { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--sage); color: #fff; }
.mode-tile.doi .ico { background: var(--blue); }
.mode-tile.ban .ico { background: var(--ochre); }
.mode-tile b { font: 600 calc(18px * var(--display-scale)) var(--f-display); }
.mode-tile span { font-size: 13.5px; opacity: .85; }
.modes3.on-paper { margin-top: 18px; }
.on-paper .mode-tile { background: var(--white); border-color: var(--line); color: var(--ink); backdrop-filter: none; }
.on-paper .mode-tile span { color: var(--ink-2); opacity: 1; }

/* Hiện dần khi cuộn (chỉ khi có JS; tắt khi giảm chuyển động) */
.js [data-reveal] { opacity: 0; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal="up"] { transform: translateY(26px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Chi tiết món đồ ---------- */
.page { padding-top: 26px; padding-bottom: 80px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); margin-bottom: 18px; }
.item-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start; }
.gallery { position: sticky; top: calc(var(--top) + 16px); }
.g-main { position: relative; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--paper-2); box-shadow: var(--sh); }
.g-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.g-main.is-done img { filter: grayscale(.85) sepia(.15); opacity: .75; }
.g-nav { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 253, 248, .92); display: grid; place-items: center; z-index: 4; box-shadow: var(--sh-sm); }
.g-nav.prev { left: 14px; } .g-nav.next { right: 14px; }
.g-count { position: absolute; right: 14px; bottom: 14px; z-index: 4; background: rgba(30, 42, 82, .85); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.thumbs { display: flex; gap: 10px; margin-top: 14px; }
.thumbs button { width: 76px; height: 76px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--paper-2); }
.thumbs button.on { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.item-info { display: grid; gap: 20px; }
.status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.item-info h1 { font-size: calc(clamp(28px, 3.3vw, 40px) * var(--display-scale)); letter-spacing: -0.015em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.deal-box { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--white); border-left: 4px solid var(--ochre); }
.deal-box.tang { border-left-color: var(--sage); }
.deal-box.doi { border-left-color: var(--blue); }
.deal-box .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.deal-box b { font: 600 calc(32px * var(--display-scale))/1.15 var(--f-display); color: var(--ochre-2); font-variant-numeric: tabular-nums; }
.deal-box.tang b { color: var(--sage); }
.deal-box b.want-t { font-size: calc(21px * var(--display-scale)); color: var(--blue); }
.deal-box .sub { font-size: 13px; color: var(--ink-2); }
.want { background: var(--blue-tint); border-radius: var(--r); padding: 14px 16px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.kv div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kv dt { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.kv dd { margin: 4px 0 0; font-weight: 600; }
.desc { font-size: 15.5px; line-height: 1.75; white-space: pre-line; max-width: 62ch; }
.abox { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh); display: grid; gap: 14px; }
.abox .q { font-size: 14px; color: var(--ink-2); }
.abox .q b { color: var(--ink); }
.abox-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.abox-acts .btn-lg { flex: 1 1 220px; }
.abox-links { display: flex; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--paper-2); padding-top: 12px; }
.ct-sum { display: flex; gap: 8px; align-items: flex-start; }
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.contacts.n1 { grid-template-columns: 1fr; } .contacts.n2 { grid-template-columns: 1fr 1fr; }
.contacts .btn { padding: 0 10px; font-size: 14px; }
.c-zalo { background: #E6EEFB !important; border-color: #C5D4F0 !important; }
.c-mess { background: #EFE8F8 !important; border-color: #D7CAEA !important; }
.c-call { background: var(--sage-tint) !important; border-color: #BCD1B8 !important; }
.contacts-lock { display: flex; gap: 10px; align-items: flex-start; border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; font-size: 13.5px; color: var(--ink-2); background: var(--paper); }
.contacts-lock .ico { color: var(--ochre); margin-top: 2px; }
.mine { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--pen-tint); font-size: 14px; }
.mine.ok { background: var(--sage-tint); }
.mine .ico { width: 22px; height: 22px; color: var(--pen); margin-top: 1px; }
.mine.ok .ico { color: var(--sage); }
.mine b { display: block; font-size: 15px; }
.safety { display: flex; gap: 12px; padding: 14px 16px; background: var(--hl-tint); border: 1px solid #E6D2A7; border-radius: var(--r); font-size: 13.5px; line-height: 1.55; }
.safety .ico { width: 22px; height: 22px; color: var(--ochre); margin-top: 1px; }
.safety b { font-size: 14.5px; }
.owner { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); color: var(--ink); text-decoration: none !important; }
.owner:hover { border-color: var(--line-2); }
.owner .nm { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.owner .sub { font-size: 13px; color: var(--ink-2); }
.owner .otx { flex: none; margin-left: auto; text-align: right; font-size: 12.5px; color: var(--ink-2); }
.owner .otx b { display: block; font: 600 calc(24px * var(--display-scale))/1 var(--f-display); color: var(--ink); }
.done-box { position: relative; padding: 22px 18px 18px; border-radius: var(--r-lg); background: var(--stamp-tint); border: 1px solid #E2B3AC; }
.done-box .stamp { position: static; display: inline-block; transform: rotate(-6deg); margin-bottom: 14px; }
.done-box .stamp.anim { animation: stampIn2 .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampIn2 { from { opacity: 0; transform: rotate(-6deg) scale(2.2); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }
.done-box p { font-size: 14.5px; }
.ok-line { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; margin-top: 8px; color: var(--sage); }
.ok-line.wait { color: var(--ochre-2); }
.req-panel h3 { font-size: calc(19px * var(--display-scale)); display: flex; gap: 8px; align-items: center; }
.req-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.req { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.req.acc { border-color: #B7CDB3; background: var(--sage-tint); }
.req .pos { font: 600 12.5px/1 var(--f-body); background: var(--paper); border-radius: 6px; padding: 6px 8px; white-space: nowrap; color: var(--ink-2); }
.req .pos.first { background: var(--hl-tint); color: var(--ochre-2); }
.req .who { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.req .who b { font-size: 14.5px; }
.req .msg { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.unread-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--stamp); color: #fff; font-size: 11px; font-weight: 700; }
.mini-contacts { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- Biểu mẫu ---------- */
.form-page { max-width: 1080px; }
.post-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.post-aside { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 12px; }
.pa-ph { height: 150px; border-radius: var(--r-lg); background: var(--paper-3) center / cover no-repeat; }
.post-aside .grid { grid-template-columns: 1fr; }
.post-aside .card { pointer-events: none; }
.ph-head h1 { font-size: calc(clamp(32px, 4vw, 46px) * var(--display-scale)); letter-spacing: -0.015em; }
.ph-head p { color: var(--ink-2); margin-top: 8px; max-width: 62ch; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); padding: 22px; margin: 22px 0 0; min-width: 0; }
legend { font: 600 calc(19px * var(--display-scale)) var(--f-display); padding: 0 8px; margin-left: -8px; }
.field { display: grid; gap: 7px; margin-top: 16px; min-width: 0; }
.field:first-of-type { margin-top: 6px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--ink-2); }
.field .req-star { color: var(--stamp); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row2 > .field { margin-top: 16px; }
.err { color: var(--stamp); font-size: 13px; font-weight: 600; }
.form-err { display: flex; gap: 10px; align-items: center; background: var(--stamp-tint); border: 1px solid #E2B3AC; color: #8E2A20; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-top: 16px; }
.form-err:empty { display: none; }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--white); transition: border-color .15s, background .15s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ci { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); flex: none; }
.choice b { display: block; font-size: 15px; }
.choice small { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; display: block; margin-top: 2px; }
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--ink); background: #FBF6EC; box-shadow: inset 0 0 0 1px var(--ink); }
.choice:has(input:focus-visible) { outline: 2.5px solid var(--ochre); outline-offset: 2px; }
.choice.tang .ci { background: var(--sage); color: #fff; }
.choice.doi .ci { background: var(--blue); color: #fff; }
.choice.ban .ci { background: var(--ochre); color: #fff; }
.choice.tang:has(input:checked) { background: var(--sage-tint); border-color: var(--sage); box-shadow: inset 0 0 0 1px var(--sage); }
.choice.doi:has(input:checked) { background: var(--blue-tint); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.choice.ban:has(input:checked) { background: var(--ochre-tint); border-color: var(--ochre); box-shadow: inset 0 0 0 1px var(--ochre); }
.choice-grid.modes { grid-template-columns: repeat(3, 1fr); }
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pick label { cursor: pointer; }
.cat-pick input { position: absolute; opacity: 0; }
.cat-pick span { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 500; background: var(--white); }
.cat-pick span .ico { color: var(--ochre); }
.cat-pick input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cat-pick input:checked + span .ico { color: var(--hl); }
.cat-pick input:focus-visible + span { outline: 2.5px solid var(--ochre); outline-offset: 2px; }
.input-affix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--white); overflow: hidden; }
.input-affix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(176, 108, 24, .14); }
.input-affix .input { border: 0; box-shadow: none !important; font: 600 17px var(--f-body); font-variant-numeric: tabular-nums; }
.input-affix span { padding: 0 14px; color: var(--ink-2); font-size: 14px; border-left: 1px solid var(--line); height: 44px; display: grid; place-items: center; background: var(--paper); }
.ch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.ch { position: relative; display: block; cursor: pointer; }
.ch input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; accent-color: var(--ink); }
.ch span { display: grid; gap: 2px; padding: 12px 40px 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; font-weight: 600; font-size: 14.5px; }
.ch span .ico { color: var(--ochre); margin-bottom: 4px; }
.ch small { font-weight: 400; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch:has(input:checked) span { border-color: var(--ink); background: #FBF6EC; }
.ch:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.up-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.up-tile img { width: 100%; height: 100%; object-fit: cover; }
.up-tile .rm { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 253, 248, .94); display: grid; place-items: center; box-shadow: var(--sh-sm); }
.up-tile .cover { position: absolute; left: 6px; bottom: 6px; background: var(--ink); color: var(--paper); font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.up-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; background: var(--paper); padding: 8px; }
.up-add:hover { border-color: var(--ochre); color: var(--ochre-2); background: var(--ochre-tint); }
.up-add .ico { width: 28px; height: 28px; margin: 0 auto 6px; }
.up-add input { display: none; }
.up-meter { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.up-meter .ok { color: var(--sage); }
.up-meter .dots { display: flex; gap: 4px; }
.up-meter .dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.up-meter .dots i.on { background: var(--sage); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-top: 18px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 2px 0 0; flex: none; }
.av-up { display: flex; gap: 16px; align-items: center; }
.av-up .av { --s: 84px; }

/* Ô chọn tỉnh/thành có thể tự nhập */
.combo { position: relative; }
.combo .input { padding-right: 42px; }
.combo-btn { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); }
.combo-btn .ico { transform: rotate(90deg); width: 17px; height: 17px; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 264px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--white); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--sh); }
.combo-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.combo-list li:hover, .combo-list li.on { background: var(--ochre-tint); }
.combo-list li.none { color: var(--ink-2); font-size: 13px; cursor: default; background: none; }

/* Đăng nhập / đăng ký */
.auth { display: grid; grid-template-columns: 1fr 1fr; max-width: 1000px; margin: 34px auto 80px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--white); box-shadow: var(--sh); }
.auth-main { padding: 38px; }
.auth-main h1 { font-size: calc(36px * var(--display-scale)); letter-spacing: -0.015em; }
.auth-side { position: relative; color: #FFF8EA; background: #2B3150 var(--img) center / cover no-repeat; min-height: 520px; display: flex; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 27, 56, .55), rgba(20, 27, 56, .92) 55%); }
.auth-side-in { position: relative; padding: 36px; margin-top: auto; }
.auth-side h2 { font-size: calc(28px * var(--display-scale)); color: #FFF8EA; }
.auth-side p { opacity: .88; margin-top: 10px; font-size: 14.5px; }
.auth-side ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.auth-side li .ico { width: 21px; height: 21px; color: var(--hl); flex: none; }
.demo-list { display: grid; gap: 8px; margin-top: 18px; }
.demo-acc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 253, 248, .1); border: 1px solid rgba(255, 253, 248, .25); color: #fff; text-align: left; width: 100%; }
.demo-acc:hover { background: rgba(255, 253, 248, .2); }
.demo-acc small { display: block; opacity: .8; font-size: 12px; }
.steps { display: flex; gap: 6px; margin: 22px 0 6px; }
.steps div { flex: 1; }
.steps i { display: block; height: 4px; border-radius: 2px; background: var(--line); }
.steps div.on i { background: var(--ochre); }
.steps div.done i { background: var(--sage); }
.steps span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-top: 6px; }
.steps div.on span { color: var(--ink); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Hồ sơ ---------- */
.pf-head { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 24px; align-items: end; background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 0 26px 24px; position: relative; overflow: hidden; }
.pf-cover { grid-column: 1 / -1; height: 150px; margin: 0 -26px 0; background: var(--paper-3) center 45% / cover no-repeat; position: relative; }
.pf-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(255, 253, 248, .5)); }
.pf-head > .av { --s: 112px; border: 4px solid var(--white); margin-top: -60px; box-shadow: var(--sh-sm); }
.pf-head h1 { font-size: calc(clamp(26px, 3.3vw, 38px) * var(--display-scale)); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.pf-meta span { display: inline-flex; align-items: center; gap: 6px; }
.vchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font: 600 12.5px var(--f-body); letter-spacing: 0; background: var(--pen-tint); color: var(--pen-2); }
.vchip.banned { background: var(--stamp-tint); color: #8E2A20; }
.pf-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.pf-stat { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.pf-stat i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--paper); color: var(--stamp); }
.pf-stat i.tang { background: var(--sage-tint); color: var(--sage); }
.pf-stat i.doi { background: var(--blue-tint); color: var(--blue); }
.pf-stat i.ban { background: var(--ochre-tint); color: var(--ochre-2); }
.pf-stat b { font: 600 calc(28px * var(--display-scale))/1 var(--f-display); display: block; }
.pf-stat span { font-size: 13px; color: var(--ink-2); }
.private { margin-top: 18px; }
.private h3 { font-size: calc(18px * var(--display-scale)); display: flex; gap: 8px; align-items: center; }
.private dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 20px; margin: 14px 0 0; }
.private dt { font-size: 12.5px; color: var(--ink-2); }
.private dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.tabs { display: flex; gap: 6px; margin: 30px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 14px; font-weight: 600; font-size: 15px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tabs button span { font-size: 12px; background: var(--paper-2); color: var(--ink); border-radius: 999px; padding: 1px 8px; }
.tabs button.on { color: var(--ink); border-color: var(--ochre); }
.tl { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.tx { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tx img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.tx h4 { font: 600 16px/1.3 var(--f-body); }
.tx h4 a { color: var(--ink); }
.tx p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.tx p b { color: var(--ink); }
.tx .when { text-align: right; font-size: 12.5px; color: var(--ink-2); }
.tx .kind { display: inline-block; font: 700 11.5px/1 var(--f-display); letter-spacing: .05em; text-transform: uppercase; color: var(--stamp); border: 1.5px solid var(--stamp); border-radius: 5px; padding: 5px 7px 4px; transform: rotate(-3deg); margin-bottom: 6px; }

/* ---------- Quy tắc ---------- */
.rules-hero { position: relative; color: #FFF8EA; border-radius: 24px; overflow: hidden; background: #2B3150 var(--img) center 55% / cover no-repeat; min-height: 300px; display: flex; align-items: flex-end; }
.rules-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 27, 56, .94) 0%, rgba(20, 27, 56, .75) 55%, rgba(20, 27, 56, .25) 100%); }
.rules-hero > div { position: relative; padding: 44px; max-width: 720px; }
.rules-hero h1 { font-size: calc(clamp(32px, 4.4vw, 52px) * var(--display-scale)); letter-spacing: -0.015em; color: #FFF8EA; }
.rules-hero p { opacity: .86; margin-top: 12px; max-width: 58ch; font-size: 16px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.rule { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.rule i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--stamp-tint); color: var(--stamp); }
.rule.ok i { background: var(--sage-tint); color: var(--sage); }
.rule h3 { font-size: calc(20px * var(--display-scale)); margin-top: 14px; }
.rule p { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }
.sec-h { font-size: calc(28px * var(--display-scale)); letter-spacing: -0.01em; margin-top: 46px; }
.flow { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: f; }
.flow li { counter-increment: f; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px; font-size: 14px; color: var(--ink-2); }
.flow li::before { content: counter(f); display: block; font: 500 calc(30px * var(--display-scale))/1 var(--f-display); color: var(--ochre); margin-bottom: 10px; }
.flow li b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }

/* ---------- Thông báo ---------- */
.nlist { list-style: none; margin: 18px 0 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.nlist li + li { border-top: 1px solid var(--paper-2); }
.nlist a { display: flex; gap: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none; align-items: flex-start; }
.nlist a:hover { background: #FFFBF2; }
.nlist .ni { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); flex: none; }
.nlist .unread { background: #FBF4E6; }
.nlist .unread .ni { background: var(--ink); color: var(--hl); }
.nlist p { font-size: 14.5px; }
.nlist time { font-size: 12.5px; color: var(--ink-2); }

/* ---------- Tin nhắn hỏi đáp ---------- */
.msgs-page { padding-top: 20px; padding-bottom: 28px; }
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - var(--top) - 48px); min-height: 560px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--sh); }
.th-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #FFFCF5; }
.th-h { padding: 18px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--paper-2); }
.th-h h1 { font-size: calc(26px * var(--display-scale)); }
.th-list ul { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.th { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 10px; border-radius: 12px; color: var(--ink); text-decoration: none !important; align-items: center; }
.th:hover { background: var(--paper); }
.th.on { background: var(--ochre-tint); }
.th.closed { opacity: .62; }
.th-ph { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-3); flex: none; }
.th-ph img { width: 100%; height: 100%; object-fit: cover; }
.th-b { display: grid; min-width: 0; }
.th-b > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-b b { font-size: 14px; font-weight: 600; }
.th-who { font-size: 12px; color: var(--ink-2); }
.th-last { font-size: 13px; color: var(--ink-2); }
.th.unread .th-last { color: var(--ink); font-weight: 600; }
.th-m { display: grid; justify-items: end; gap: 4px; font-size: 11.5px; color: var(--ink-3); align-self: start; padding-top: 2px; }
.th-empty { padding: 30px 16px; color: var(--ink-2); font-size: 14px; text-align: center; }
.convo { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.convo-empty { margin: auto; text-align: center; max-width: 420px; padding: 30px; }
.ce-ph { width: 180px; height: 220px; margin: 0 auto 22px; border-radius: 999px 999px 14px 14px; background: var(--paper-3) center / cover no-repeat; box-shadow: var(--sh); }
.convo-empty h2 { font-size: calc(26px * var(--display-scale)); }
.convo-empty p { color: var(--ink-2); margin: 10px 0 20px; }
.cv-h { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cv-back { display: none; }
.cv-post { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none !important; min-width: 0; flex: 1 1 260px; }
.cv-post > img { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; flex: none; }
.cv-post > div { display: grid; gap: 4px; min-width: 0; }
.cv-post > div > b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-post .small { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cv-post .hangtag.inline { height: 22px; font-size: 11.5px; padding: 0 9px 0 20px; }
.cv-post .hangtag.inline::before { left: 6px; width: 6px; height: 6px; margin-top: -3px; }
.cv-post .status { height: 22px; font-size: 11.5px; }
.price-s { font: 600 15px var(--f-display); color: var(--ochre-2); }
.cv-who { display: flex; gap: 10px; align-items: center; }
.cv-who > div { display: grid; }
.cv-who b { font-size: 14px; }
.cv-acts { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.cv-contacts { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--paper-2); background: var(--sage-tint); flex-wrap: wrap; }
.cv-contacts .contacts { display: flex; gap: 8px; }
.cv-contacts .btn { min-height: 34px; font-size: 13px; }
.cv-note { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-2); padding: 8px 16px; background: var(--paper); border-bottom: 1px solid var(--paper-2); text-align: center; }
.cv-note .ico { color: var(--ochre); width: 15px; height: 15px; }
.cv-msgs { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; background:
  radial-gradient(circle at 1px 1px, rgba(30, 42, 82, .06) 1px, transparent 0) 0 0 / 22px 22px, #FFFDF8; }
.cv-day { text-align: center; margin: 12px 0 6px; }
.cv-day span { font-size: 12px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.msg { display: flex; flex-direction: column; max-width: min(76%, 520px); }
.msg.them { align-self: flex-start; align-items: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: 11.5px; color: var(--ink-2); margin: 4px 6px 2px; }
.bub { padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.them .bub { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.me .bub { background: var(--ink); color: var(--paper); border-bottom-right-radius: 5px; }
.msg time { font-size: 11px; color: var(--ink-3); margin: 2px 6px 4px; }
.msg.k-image .bub { padding: 4px; background: var(--white) !important; border: 1px solid var(--line); }
.msg.k-image img { max-width: 260px; max-height: 300px; min-width: 140px; min-height: 110px; border-radius: 12px; cursor: zoom-in; object-fit: cover; background: var(--paper-2); }
.msg.sys { align-self: center; max-width: 90%; font-size: 12.5px; color: var(--ink-2); background: var(--hl-tint); border: 1px solid #E6D2A7; padding: 6px 12px; border-radius: 999px; text-align: center; margin: 6px 0; }
.mcard { display: flex; gap: 10px; align-items: flex-start; white-space: normal; min-width: 210px; }
.mcard > .ico { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--ochre-tint); color: var(--ochre-2); flex: none; }
.mcard > div { display: grid; gap: 2px; }
.mcard span { font-size: 12px; opacity: .75; }
.mcard b { font: 600 calc(18px * var(--display-scale))/1.25 var(--f-display); }
.mcard p { font-size: 13px; opacity: .85; display: flex; gap: 4px; align-items: center; }
.mcard .btn { margin-top: 8px; justify-self: start; }
.msg.me .mcard > .ico { background: rgba(255, 255, 255, .12); color: var(--hl); }
.cv-form { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: grid; gap: 8px; background: var(--white); }
.qchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.qchips .pill { flex: none; font-size: 12.5px; min-height: 30px; }
.modal .qchips { flex-wrap: wrap; margin-top: 14px; }
.cv-tools { display: flex; gap: 6px; align-items: flex-end; }
.cv-tools .icon-btn { width: 40px; height: 40px; color: var(--ink-2); }
.cv-tools textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 140px; resize: none; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; outline: 0; background: var(--paper); line-height: 1.4; font-size: 14.5px; }
.cv-tools textarea:focus { border-color: var(--ink); background: var(--white); }
.cv-tools .btn-primary { width: 46px; min-height: 42px; padding: 0; }
.cv-closed { padding: 16px; text-align: center; font-size: 13.5px; color: var(--ink-2); border-top: 1px solid var(--line); background: var(--paper); }

/* ---------- Quản trị (phần dùng chung) ---------- */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.adm-stat { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.adm-stat b { font: 600 30px/1 var(--f-display); display: block; }
.adm-stat span { font-size: 13px; color: var(--ink-2); }
.adm-stat.alert { background: var(--stamp-tint); }
.rep { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.rep + .rep { margin-top: 12px; }
.rep.closed { opacity: .75; }
.rep img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; }
.rep .why { display: inline-flex; gap: 6px; align-items: center; background: var(--stamp-tint); color: #8E2A20; font-weight: 600; font-size: 12.5px; border-radius: 6px; padding: 4px 9px; }
.rep .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tbl-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #FFFCF5; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--paper-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl img.th { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.tbl .ttl { font-weight: 600; max-width: 280px; }

/* ---------- Hướng dẫn ---------- */
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.guide-grid h3 { font-size: 19px; }
.acc-grid { display: grid; gap: 10px; }
.acc { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.acc code { font-size: 12.5px; color: var(--ink-2); }
.acc b { display: block; font-size: 14.5px; }
.scen { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 12px; }
.scen li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14px; color: var(--ink-2); }
.scen li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--hl); font: 600 15px var(--f-display); }
.scen b { color: var(--ink); display: block; margin-bottom: 2px; font-size: 15px; }
.req-tbl td:first-child { font-weight: 600; width: 42%; }
.req-tbl .yes { color: var(--sage); font-weight: 600; display: inline-flex; gap: 6px; align-items: flex-start; }

/* ---------- Hộp thoại / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 27, 56, .5); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(540px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--white); border-radius: 20px; box-shadow: 0 30px 70px -20px rgba(20, 27, 56, .55); padding: 24px; animation: pop .18s ease-out; }
.modal.wide { width: min(780px, 100%); }
.modal.img { width: auto; max-width: min(960px, 100%); padding: 6px; background: var(--ink); }
.modal.img img { max-height: calc(100vh - 60px); border-radius: 14px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal h2 { font-size: calc(25px * var(--display-scale)); padding-right: 30px; }
.modal .mx { float: right; margin: -8px -8px 0 0; }
.modal-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.radio-list { display: grid; gap: 8px; margin-top: 14px; }
.radio-list label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 14.5px; }
.radio-list label:has(input:checked) { border-color: var(--stamp); background: var(--stamp-tint); }
.radio-list.ok label:has(input:checked) { border-color: var(--ink); background: #FBF6EC; }
.radio-list input { accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
#toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--paper); padding: 13px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 500; box-shadow: 0 16px 40px -14px rgba(20, 27, 56, .6); animation: pop .2s ease-out; }
.toast .ico { color: var(--mint); width: 20px; height: 20px; }
.toast.err .ico { color: #F2A397; }

.demo-pill, .font-pill { position: fixed; bottom: 18px; z-index: 50; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; box-shadow: var(--sh); }
.demo-pill { right: 18px; background: var(--hl-tint); border: 1px solid var(--hl); color: var(--ink); }
.demo-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stamp); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.font-pill { left: 18px; background: var(--white); border: 1px solid var(--line-2); color: var(--ink); }
.font-pill .ico { color: var(--ochre); }
.font-pop { position: fixed; left: 18px; bottom: 68px; z-index: 55; width: min(340px, calc(100% - 36px)); background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh); padding: 14px; display: grid; gap: 8px; }
.font-pop button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); }
.font-pop button:hover { border-color: var(--line-2); }
.font-pop button.on { border-color: var(--ink); background: #FBF6EC; box-shadow: inset 0 0 0 1px var(--ink); }
.fp-sample { font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.font-pop small { font-size: 12px; color: var(--ink-2); }

/* ---------- Chân trang & thanh điều hướng dưới (di động) ---------- */
.foot { background: var(--ink); color: var(--paper); margin-top: 0; }
.foot-photo { height: 220px; background: #2B3150 center 60% / cover no-repeat; position: relative; }
.foot-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 42, 82, .05) 0%, rgba(30, 42, 82, .35) 50%, var(--ink) 100%); }
.foot-in { display: grid; grid-template-columns: auto 1fr; gap: 18px 40px; align-items: center; padding-top: 6px; padding-bottom: 34px; }
.foot-logo { color: var(--paper); }
.foot-logo small { color: rgba(245, 241, 232, .7); }
.foot nav { display: flex; gap: 8px 22px; flex-wrap: wrap; justify-content: flex-end; }
.foot nav a { color: var(--paper); font-weight: 500; font-size: 14px; }
.foot .credit { grid-column: 1 / -1; font-size: 12px; color: rgba(245, 241, 232, .55); border-top: 1px solid rgba(245, 241, 232, .14); padding-top: 14px; }
.bnav { display: none; }
body[data-page="messages"] .demo-pill, body[data-page="messages"] .font-pill, body[data-page="messages"] .font-pop { display: none; }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--ink-2); }
.spin { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ochre); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-in { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { height: 460px; max-width: 640px; }
  .browse { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; }
  .side .filters { grid-column: 1 / -1; }
  .item-grid { grid-template-columns: 1fr; gap: 28px; }
  .gallery { position: static; }
  .post-grid { grid-template-columns: 1fr; }
  .post-aside { display: none; }
  .flow, .steps4 { grid-template-columns: 1fr 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 290px 1fr; }
  .private dl { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - var(--top) - 110px - env(safe-area-inset-bottom)); border-radius: 16px; }
  .inbox.has-open .th-list { display: none; }
  .inbox:not(.has-open) .convo { display: none; }
  .th-list { border-right: 0; }
  .cv-back { display: grid; margin-left: -8px; }
  .cv-who { display: none; }
  .cv-h { gap: 8px; }
  .cv-post { flex: 1 1 0; }
  .cv-h { display: grid; grid-template-columns: 34px minmax(0, 1fr) 42px; grid-template-areas: "back post flag" "acts acts acts"; gap: 8px; padding: 10px 12px; }
  .cv-back { grid-area: back; }
  .cv-post { grid-area: post; }
  .cv-flag { grid-area: flag; }
  .cv-acts { grid-area: acts; margin-left: 0; }
  .cv-acts .btn { flex: 1; padding: 4px 8px; font-size: 12.5px; white-space: normal; line-height: 1.2; min-height: 38px; }
  .modes3 { grid-template-columns: 1fr; }
  .choice-grid.modes { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --top: 60px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .tsearch, .tact .btn, .tact .icon-btn, .me-btn span.n, .logo small { display: none; }
  .topbar .wrap { gap: 10px; }
  .logo b { font-size: calc(21px * var(--display-scale)); }
  .m-search { display: block; margin-bottom: 14px; }
  .hero { padding-top: 22px; }
  .hero .lead { font-size: 16px; }
  .hero-cta .btn { flex: 1; }
  .facts { grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-top: 28px; }
  .facts dd { font-size: calc(28px * var(--display-scale)); }
  .facts dt { font-size: 12px; }
  .hero-art { height: 380px; }
  .arch { width: 70%; right: 0; }
  .snap { width: 46%; left: 0; bottom: 18px; }
  .snap span { font-size: 13px; padding: 6px 2px 8px; }
  .hero-art .pin { display: none; }
  .hero-art figcaption { bottom: -22px; }
  .side { grid-template-columns: 1fr; }
  .side .rules-mini { display: none; }
  .filters:not([open]) { padding: 12px 16px; }
  .res-h h2 { font-size: calc(24px * var(--display-scale)); }
  .res-tools { width: 100%; }
  .mode-seg { flex: 1 1 100%; overflow-x: auto; grid-auto-columns: auto; }
  .res-h .select { flex: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { border-radius: 12px; }
  .card-b { padding: 10px; gap: 4px; }
  .card h3 { font-size: 14px; }
  .card-price b { font-size: 16.5px; }
  .card-f .t { display: none; }
  .hangtag { height: 24px; font-size: 11px; padding: 0 9px 0 19px; top: 8px; left: 6px; }
  .hangtag::before { left: 6px; width: 6px; height: 6px; margin-top: -3px; }
  .hangtag .ico { display: none; }
  .hangtag.inline .ico { display: inline; }
  .stamp { font-size: 14px; padding: 6px 10px 5px; border-width: 2.5px; }
  .ribbon { font-size: 10.5px; height: 22px; padding: 0 7px; right: 6px; top: 8px; }
  .band-in { padding-top: 56px; padding-bottom: 56px; }
  .steps4 { grid-template-columns: 1fr; gap: 18px; margin-top: 30px; }
  .steps4 li { display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; }
  .steps4 li::before { grid-row: span 2; font-size: 34px; margin: 0; }
  .kv { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr !important; }
  .thumbs button { width: 60px; height: 60px; }
  .req { grid-template-columns: 1fr; }
  .req .acts { flex-direction: row; align-items: center; flex-wrap: wrap; }
  fieldset { padding: 16px; border-radius: 16px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .ch-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; margin: 16px 0 40px; border-radius: 18px; }
  .auth-main { padding: 22px; }
  .auth-side { min-height: 0; }
  .auth-side-in { padding: 22px; margin-top: 120px; }
  .pf-head { grid-template-columns: 1fr; padding: 0 18px 18px; }
  .pf-cover { margin: 0 -18px; height: 120px; }
  .pf-head > .av { --s: 88px; }
  .pf-acts { justify-content: flex-start; }
  .pf-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pf-stat { padding: 12px; gap: 10px; }
  .pf-stat i { width: 34px; height: 34px; }
  .pf-stat b { font-size: 22px; }
  .private dl { grid-template-columns: 1fr; }
  .tx { grid-template-columns: 56px 1fr; }
  .tx img { width: 56px; height: 56px; }
  .tx .when { grid-column: 2; text-align: left; }
  .rules-hero > div { padding: 24px; }
  .rules-hero { min-height: 340px; border-radius: 18px; }
  .flow { grid-template-columns: 1fr; }
  .rep { grid-template-columns: 64px 1fr; }
  .rep img { width: 64px; height: 64px; }
  .msgs-page { padding-top: 10px; padding-bottom: 10px; }
  .banner .wrap { font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
  body[data-page="messages"] #banner { display: none; }
  .msg { max-width: 88%; }
  .foot-photo { height: 150px; }
  .foot-in { grid-template-columns: 1fr; }
  .foot nav { justify-content: flex-start; }
  .demo-pill, .font-pill { bottom: calc(84px + env(safe-area-inset-bottom)); height: 34px; font-size: 12.5px; padding: 0 12px; }
  .demo-pill { right: 12px; } .font-pill { left: 12px; }
  .font-pill span { display: none; }
  .font-pop { left: 12px; bottom: calc(128px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--white); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-2); padding: 4px 0; position: relative; text-decoration: none; }
  .bnav a .ico { width: 22px; height: 22px; }
  .bnav a.on { color: var(--ochre-2); }
  .bnav a.plus span.pl { width: 50px; height: 50px; margin-top: -24px; border-radius: 16px; background: var(--ink); color: var(--paper); display: grid; place-items: center; box-shadow: var(--sh); }
  .bnav .dot { top: 0; right: calc(50% - 22px); border-color: var(--white); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
#main:focus { outline: none; }
