:root {
  --bg: #F7F7F9; --card: #FFFFFF; --line: #EEEEF1; --line2: #D8D8DE; --ink: #1C1C21; --ink2: #3A3A44; --muted: #6E6E78;
  --brand: #F05A28; --btn: #E14F1C; --brand-ink: #D24816; --brand-soft: #FFEDE5; --brand-soft2: #FFF3EC;
  --ok: #15803D; --ok-bg: #E7F6EC; --warn: #B45309; --warn-bg: #FEF3C7; --bad: #C2261C; --bad-bg: #FDE8E7; --info: #1D4ED8; --info-bg: #E6EEFE; --vio: #6D28D9; --vio-bg: #F1EAFE;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--brand-ink); }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1 { font-size: 24px; margin: 0; } h2 { font-size: 17px; margin: 0; } h3 { font-size: 15px; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .xs { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 12px; } .gap4 { gap: 4px; } .gap16 { gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.card.pad0 { padding: 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #F3F3F5; font-size: 14px; }
.kv:first-of-type { border-top: 0; }
.kv > span:first-child { color: var(--muted); flex-shrink: 0; } .kv > span:last-child { text-align: right; overflow-wrap: anywhere; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; min-height: 44px; padding: 0 18px; font-size: 14px; font-weight: 700; background: var(--btn); color: #fff; white-space: nowrap; text-decoration: none; }
.btn.sec { background: #fff; color: var(--ink); border: 1px solid var(--line2); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--brand-ink); padding: 0 6px; min-height: 36px; font-weight: 600; }
.btn.danger { background: var(--bad); } .btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; } .btn.block { width: 100%; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #EDEDF0; color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); } .pill.brand { background: var(--brand-soft); color: var(--brand-ink); } .pill.vio { background: var(--vio-bg); color: var(--vio); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid #E4E4E9; background: #fff; color: var(--ink2); border-radius: 999px; padding: 0 14px; min-height: 36px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--brand-soft); color: var(--brand-ink); border-color: #F7B79F; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: #E9E9ED; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; min-height: 36px; padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(28,28,33,.12); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
label.f input, label.f select, label.f textarea, .inp { width: 100%; background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 0 12px; min-height: 44px; font-weight: 400; }
label.f textarea { padding: 10px 12px; resize: vertical; }
label.cb { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; } label.cb input { width: 20px; height: 20px; accent-color: var(--btn); margin-top: 1px; flex-shrink: 0; }
.err { color: var(--bad); font-size: 13px; } .hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.note { background: var(--brand-soft2); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--ink2); }
.note.gray { background: #F1F1F4; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; border-radius: 32px; font-size: 22px; background: #8B4A2B; color: #fff; }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid #F3F3F5; padding: 12px 0; color: var(--ink); }
.list-item:first-child { border-top: 0; }
.bar { height: 8px; border-radius: 4px; background: #EDEDF0; overflow: hidden; display: flex; } .bar > span { background: var(--brand); border-radius: 4px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 1000; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 18px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }
.overlay { position: fixed; inset: 0; z-index: 500; background: rgba(28,28,33,.45); display: flex; align-items: flex-end; justify-content: center; animation: ov-in .16s ease-out; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px;
  animation: sheet-in .22s cubic-bezier(.2,.8,.2,1); will-change: transform; }
body.modal-open { overflow: hidden; } /* page behind a sheet must not scroll */
@keyframes ov-in { from { background: rgba(28,28,33,0); } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .overlay, .sheet { animation: none; } }
button.busy { opacity: .6; pointer-events: none; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 16px; } .sheet { border-radius: 22px; padding-bottom: 20px; animation-name: sheet-pop; } @keyframes sheet-pop { from { transform: scale(.97); opacity: 0; } } .sheet.wide { max-width: 980px; } }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: #FAFAFB; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid #F3F3F5; vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #FFF9F6; }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.empty { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
.spinner { text-align: center; color: var(--muted); padding: 40px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* ---- Hoạt động: photo grid + full-screen viewer ---- */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 14px; overflow: hidden; }
.pgrid.n1 { grid-template-columns: 1fr; } .pgrid.n2 { grid-template-columns: 1fr 1fr; } .pgrid.n4 { grid-template-columns: 1fr 1fr; }
.pgrid button { position: relative; padding: 0; border: 0; background: #EEEEF1; aspect-ratio: 1; cursor: zoom-in; overflow: hidden; }
.pgrid.n1 button { aspect-ratio: 4/3; }
.pgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pgrid .more { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pgrid .tag { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.92); color: var(--warn); }
.lightbox { position: fixed; inset: 0; z-index: 900; background: #000; display: flex; flex-direction: column; touch-action: pan-y; }
.lightbox .lb-top { display: flex; align-items: center; justify-content: space-between; color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; font-size: 14px; }
.lightbox .lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox .lb-cap { color: #ccc; font-size: 13px; text-align: center; padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); }
.lightbox button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightbox .lb-prev, .lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .lb-prev { left: 10px; } .lightbox .lb-next { right: 10px; }
@media (pointer: coarse) { .lightbox .lb-prev, .lightbox .lb-next { display: none; } }
.likebtn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink2); padding: 6px 8px; border-radius: 10px; cursor: pointer; min-height: 40px; }
.likebtn:hover { background: #F6F6F8; } .likebtn.on { color: #E11D48; } .likebtn.on svg { fill: #E11D48; }
.likebtn.pop svg { animation: like-pop .3s ease-out; } @keyframes like-pop { 50% { transform: scale(1.35); } }
.cmt { display: flex; gap: 10px; padding: 8px 0; } .cmt .bub { background: #F3F3F6; border-radius: 14px; padding: 8px 12px; min-width: 0; } .cmt .bub p { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Joy mascot */
.joy { display: block; flex-shrink: 0; object-fit: contain; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.joy-in { animation: joyIn .55s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes joyIn { from { opacity: 0; transform: translateY(14px) scale(.85); } to { opacity: 1; transform: none; } }
.joy-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 22px 16px 26px; color: var(--ink); }
.joy-empty .joy { margin-bottom: 4px; animation: joyIn .55s cubic-bezier(.34,1.56,.64,1) both; }
.joy-pop { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; background: rgba(20,20,30,.28); padding: 24px; animation: fadeIn .18s ease both; }
.joy-pop.out { opacity: 0; transition: opacity .2s; }
.joy-pop-card { background: #fff; border-radius: 22px; padding: 20px 26px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; max-width: 300px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.joy-pop-card b { font-size: 17px; }
.joy-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; }
.joy-card .grow { min-width: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .joy-in, .joy-empty .joy, .joy-pop { animation: none; } }
.logo-img { background: none; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
