:root {
  --red: #E8283E; --red-soft: #FDECEE;
  --yellow: #FDB515; --yellow-soft: #FFF6DB;
  --blue: #0A74C9; --blue-d: #085EA3; --blue-soft: #E6F1FB;
  --ink: #1B2433; --muted: #6B7686; --bg: #F3F5F9; --card: #fff; --line: #E5E9F0; --hover: #F0F3F8;
  --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.04);
  --radius: 14px;
  --brand: linear-gradient(90deg, var(--red), var(--yellow), var(--blue));
  --nav-h: 60px;
}
[data-theme=dark] {
  --red-soft: #3a1b21; --yellow-soft: #3a3016; --blue-soft: #14283b;
  --ink: #E8EDF5; --muted: #98A3B5; --bg: #0F141C; --card: #171E29; --line: #263041; --hover: #1F2837;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img, video { max-width: 100%; display: block; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; } .between { justify-content: space-between; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; background: var(--hover); transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.96); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--blue); color: #fff; } .btn-primary:hover { background: var(--blue-d); filter: none; }
.btn-red { background: var(--red); color: #fff; } .btn-yellow { background: var(--yellow); color: #3b2a00; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-sm { padding: 5px 12px; font-size: 13px; } .btn-block { width: 100%; padding: 11px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; position: relative; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea { resize: none; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- Layout ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; padding: 0 16px; gap: 14px; }
.nav::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand); }
.nav .logo img { height: 36px; border-radius: 6px; } [data-theme=dark] .nav .logo img { background: #fff; padding: 2px 6px; }
.nav .search { position: relative; flex: 0 1 320px; }
.nav .search input { padding-left: 40px; border-radius: 999px; background: var(--hover); border-color: transparent; }
.nav .search svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.nav .links { display: flex; gap: 4px; margin: 0 auto; }
.nav .links a, .tabbar a { position: relative; display: grid; place-items: center; width: 64px; height: 44px; border-radius: 12px; color: var(--muted); }
.nav .links a:hover { background: var(--hover); text-decoration: none; }
.nav a.active { color: var(--blue); }
.nav .links a.active::after { content: ''; position: absolute; bottom: -8px; left: 14px; right: 14px; height: 3px; border-radius: 3px; background: var(--blue); z-index: 2; }
.badge { position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.layout { max-width: 1240px; margin: 0 auto; padding: 18px 16px 90px; display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.layout.two { grid-template-columns: 250px minmax(0, 1fr); } .layout.one { grid-template-columns: minmax(0, 820px); justify-content: center; }
.side { position: sticky; top: calc(var(--nav-h) + 18px); display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - var(--nav-h) - 30px); overflow-y: auto; scrollbar-width: none; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); font-weight: 500; }
.menu a:hover { background: var(--hover); text-decoration: none; }
.menu a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.menu a .badge { position: static; margin-left: auto; }
.menu .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.menu h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px 4px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h3 { font-size: 16px; margin-bottom: 10px; }
.card.flush { padding: 0; overflow: hidden; }
.tabbar { display: none; }
.footer-note { font-size: 12px; color: var(--muted); padding: 0 8px; }

/* ---------- Avatars ---------- */
.av { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) * .4); background: var(--blue); position: relative; user-select: none; }
.av.c0 { background: var(--red); } .av.c1 { background: var(--blue); } .av.c2 { background: #E39A00; } .av.c3 { background: #12997a; } .av.c4 { background: #7a4fd1; }
.av-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; flex: none; }
.dot-online { position: absolute; right: 0; bottom: 0; width: 25%; height: 25%; min-width: 9px; min-height: 9px; border-radius: 50%; background: #2fbf71; border: 2px solid var(--card); }
.role-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: middle; margin-left: 4px; background: var(--yellow-soft); color: #9a6a00; }
.role-badge.admin { background: var(--red-soft); color: var(--red); }
.uname { font-weight: 600; color: var(--ink); } a.uname:hover { text-decoration: underline; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.connection-suggestion { display: grid; grid-template-columns: 40px minmax(0,1fr) 44px; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.connection-suggestion:last-child { border-bottom: 0; }
.connection-meta { min-width: 0; overflow-wrap: anywhere; }
.connection-meta p { margin: 4px 0 0; line-height: 1.5; }
.connection-actions { grid-column: 2 / 4; }
.connection-actions .btn { min-height: 44px; }
.connection-suggestion > .icon-btn { width: 44px; height: 44px; }
@media (min-width: 821px) {
  #sug .connection-suggestion { grid-template-columns: 40px minmax(0,1fr) auto 44px; align-items: center; }
  #sug .connection-suggestion > .icon-btn { grid-column: 4; grid-row: 1; }
  #sug .connection-actions { grid-column: 3; grid-row: 1; }
}
.user-row .meta { flex: 1; min-width: 0; line-height: 1.3; } .user-row .meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Stories ---------- */
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.story { flex: none; width: 78px; text-align: center; cursor: pointer; font-size: 12px; }
.story .ring { width: 66px; height: 66px; margin: 0 auto 4px; border-radius: 50%; padding: 3px; background: var(--brand); display: grid; place-items: center; }
.story .ring.seen { background: var(--line); }
.story .ring .av { border: 3px solid var(--card); }
.story .add { background: var(--hover); display: grid; place-items: center; color: var(--blue); width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 4px; border: 2px dashed var(--blue); }
.story span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv { position: fixed; inset: 0; z-index: 200; background: #000; display: grid; place-items: center; }
.sv-box { position: relative; width: min(420px, 100vw); height: min(780px, 100vh); background: #111; border-radius: 14px; overflow: hidden; display: grid; place-items: center; color: #fff; }
.sv-box img:not(.av), .sv-box video { width: 100%; height: 100%; object-fit: contain; }
.sv-text { padding: 30px; font-size: 26px; font-weight: 700; text-align: center; width: 100%; height: 100%; display: grid; place-items: center; word-break: break-word; }
.sv-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.sv-bars i { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; } .sv-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv-head { position: absolute; top: 20px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 3; text-shadow: 0 1px 4px #000; }
.sv-cap { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 18px 22px; background: linear-gradient(transparent, rgba(0,0,0,.7)); z-index: 3; text-align: center; }
.sv-nav { position: absolute; top: 60px; bottom: 80px; width: 40%; z-index: 2; } .sv-nav.l { left: 0; } .sv-nav.r { right: 0; }
.sv .x { position: absolute; top: 14px; right: 14px; z-index: 5; color: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; } .swatches button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; } .swatches button.on { border-color: var(--ink); }

/* ---------- Composer ---------- */
.composer textarea { border: 0; padding: 6px 0; font-size: 16px; min-height: 52px; box-shadow: none !important; background: transparent; }
.composer .tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.composer .tool { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.composer .tool:hover, .composer .tool.on { background: var(--hover); color: var(--ink); }
.composer .tool.on { background: var(--blue-soft); color: var(--blue); }
.composer select { width: auto; padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.preview { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--hover); display: grid; place-items: center; font-size: 11px; text-align: center; padding: 4px; }
.preview img, .preview video { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; line-height: 1; }
.poll-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* ---------- Post ---------- */
.post { padding: 0; }
.post-main { padding: 14px 16px 6px; }
.post-head { display: flex; gap: 10px; align-items: flex-start; }
.post-head .who { flex: 1; min-width: 0; line-height: 1.3; }
.post-head .sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.post-body { margin: 10px 0 8px; white-space: pre-wrap; word-break: break-word; }
.post-body.clamp { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.more-link { color: var(--blue); font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--blue-soft); color: var(--blue); }
.chip.q { background: var(--yellow-soft); color: #9a6a00; } .chip.ok { background: #dcf5e8; color: #12805a; } .chip.red { background: var(--red-soft); color: var(--red); }
.chip.btn-like { cursor: pointer; } .chip.on { background: var(--blue); color: #fff; }
.media-grid { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; margin: 8px 0; max-height: 560px; }
.media-grid.n1 { grid-template-columns: 1fr; } .media-grid.n2 { grid-template-columns: 1fr 1fr; } .media-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; } .media-grid.n3 > :first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-grid > * { position: relative; background: #000; min-height: 0; overflow: hidden; }
.media-grid img, .media-grid video { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; max-height: 560px; }
.media-grid.n1 img, .media-grid.n1 video { object-fit: contain; background: var(--hover); }
.media-grid.n2 > *, .media-grid.n4 > * { aspect-ratio: 1; }
.media-grid .more { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 700; pointer-events: none; }
.file-att { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; color: var(--ink); }
.file-att:hover { background: var(--hover); text-decoration: none; }
.file-att svg { color: var(--blue); }
.embed { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.poll { margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { position: relative; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.poll-opt i { position: absolute; inset: 0 auto 0 0; background: var(--blue-soft); z-index: 0; transition: width .4s; }
.poll-opt span { position: relative; z-index: 1; } .poll-opt.mine { border-color: var(--blue); font-weight: 600; } .poll-opt.mine i { background: #cfe5f8; }
.post-stats { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); padding: 4px 0 8px; }
.post-stats .rx { display: inline-flex; align-items: center; gap: 4px; }
.post-actions { display: flex; border-top: 1px solid var(--line); padding: 3px 8px; gap: 2px; }
.pa { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13.5px; position: relative; }
.pa:hover { background: var(--hover); }
.pa.on-like { color: var(--blue); } .pa.on-love { color: var(--red); } .pa.on-haha, .pa.on-wow, .pa.on-sad { color: #d99200; } .pa.on-angry { color: #d4551c; }
.pa.on-rp { color: #12997a; } .pa.on-bm { color: var(--yellow); } .pa.on-bm svg { fill: var(--yellow); }
.rx-wrap { position: relative; flex: 1; display: flex; }
.rx-pop { position: absolute; bottom: 100%; left: 0; padding-bottom: 6px; display: none; z-index: 10; }
.rx-pop > div { display: flex; gap: 2px; background: var(--card); padding: 6px 8px; border-radius: 999px; box-shadow: 0 4px 20px rgba(0,0,0,.18); }
.rx-wrap:hover .rx-pop, .rx-wrap.open .rx-pop { display: block; }
.rx-pop button { font-size: 26px; width: 40px; height: 40px; border-radius: 50%; transition: transform .12s; line-height: 1; }
.rx-pop button:hover { transform: scale(1.35) translateY(-4px); }
.pop-menu { position: absolute; z-index: 60; background: var(--card); border-radius: 12px; box-shadow: 0 6px 28px rgba(0,0,0,.2); padding: 6px; min-width: 200px; }
.pop-menu button, .pop-menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; text-align: left; color: var(--ink); font-size: 14px; }
.pop-menu button:hover, .pop-menu a:hover { background: var(--hover); text-decoration: none; }
.pop-menu .danger { color: var(--red); }

/* ---------- Comments ---------- */
.comments { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.cm { display: flex; gap: 8px; margin-top: 10px; }
.cm .bubble { background: var(--hover); padding: 8px 12px; border-radius: 16px; display: inline-block; max-width: 100%; word-break: break-word; white-space: pre-wrap; }
.cm .bubble b { display: block; font-size: 13.5px; }
.cm.best .bubble { background: #e4f7ec; border: 1px solid #9bdcb7; }
.cm .acts { font-size: 12px; color: var(--muted); display: flex; gap: 12px; padding: 2px 8px; align-items: center; flex-wrap: wrap; }
.cm .acts button { font-weight: 600; color: var(--muted); font-size: 12px; } .cm .acts button:hover { text-decoration: underline; } .cm .acts .on { color: var(--red); }
.cm img.cm-img { max-width: 220px; border-radius: 12px; margin-top: 4px; }
.replies { margin-left: 40px; }
.cm-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.cm-form textarea { flex: 1; border-radius: 18px; padding: 8px 14px; min-height: 38px; max-height: 120px; background: var(--hover); border-color: transparent; }

/* ---------- Profile ---------- */
.cover { height: 220px; background: linear-gradient(120deg, var(--red), var(--yellow) 45%, var(--blue)); background-size: cover; background-position: center; border-radius: var(--radius) var(--radius) 0 0; position: relative; }
.profile-head { padding: 0 20px 14px; margin-top: -46px; position: relative; }
.profile-head .av { border: 4px solid var(--card); }
.profile-head h1 { font-size: 22px; line-height: 1.2; }
.stats { display: flex; gap: 22px; margin: 10px 0; } .stats button { text-align: left; } .stats b { font-size: 17px; display: block; line-height: 1.2; } .stats span { font-size: 12.5px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-top: 1px solid var(--line); padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; background: var(--hover); } .tabs .active { color: var(--blue); border-bottom-color: var(--blue); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.filters .chip { padding: 6px 13px; font-size: 13px; background: var(--card); color: var(--ink); border: 1px solid var(--line); } .filters .chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Groups ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gcard { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.gcard .gcover { height: 90px; background: linear-gradient(120deg, var(--blue), var(--yellow)); background-size: cover; background-position: center; }
.gcard:nth-child(3n+2) .gcover { background-color: var(--red); background-image: linear-gradient(120deg, var(--red), var(--yellow)); }
.gcard:nth-child(3n) .gcover { background-image: linear-gradient(120deg, var(--yellow), var(--red)); }
.gcard .gbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

/* ---------- Modal / toast / lightbox ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,15,25,.55); z-index: 150; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--card); border-radius: 18px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal h2 { font-size: 18px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.toast-box { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.25); animation: fade .2s; }
.toast.err { background: var(--red); color: #fff; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 250; display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; }
.lightbox .nv { position: absolute; top: 50%; color: #fff; font-size: 34px; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.12); transform: translateY(-50%); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .7s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } } @keyframes fade { from { opacity: 0; } }
.skeleton { height: 140px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, var(--hover) 50%, var(--card) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden; }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.auth-hero::before { width: 420px; height: 420px; right: -120px; top: -120px; } .auth-hero::after { width: 300px; height: 300px; left: -80px; bottom: -80px; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero img { width: 180px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.auth-hero h1 { font-size: 40px; line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.auth-hero ul { list-style: none; display: grid; gap: 10px; font-size: 16px; } .auth-hero li::before { content: '✓'; font-weight: 800; margin-right: 10px; background: rgba(255,255,255,.28); width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; }
.auth-form { display: grid; place-items: center; padding: 28px; background: var(--card); }
.auth-form form { width: min(400px, 100%); }
.auth-form h2 { font-size: 26px; margin-bottom: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat-tile { border-radius: 12px; padding: 14px; background: var(--hover); } .stat-tile b { font-size: 26px; display: block; line-height: 1.1; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; } table.t td, table.t th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .layout { grid-template-columns: 220px minmax(0, 1fr); } .layout > .side.right { display: none; } .nav .search { flex-basis: 220px; } }
@media (max-width: 820px) {
  .layout, .layout.two { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 90px; gap: 12px; }
  .layout > .side { display: none; }
  .nav .links { display: none; } .nav .search { flex: 1; }
  .nav .hide-m { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--card); border-top: 1px solid var(--line); justify-content: space-around; padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { width: auto; flex: 1; height: 48px; } .tabbar a .badge { right: calc(50% - 22px); }
  .auth { grid-template-columns: 1fr; } .auth-hero { padding: 30px 24px; } .auth-hero h1 { font-size: 28px; } .auth-hero ul { display: none; } .auth-hero img { width: 120px; }
  .cover { height: 150px; }
  .toast-box { bottom: 90px; }
}

/* =====================================================================
   Design layer — "vở học sinh": giấy ô li, lề đỏ, bút dạ quang, khối xiên theo chữ HVO
   ===================================================================== */
:root {
  --paper: #F6F9FD; --grid: rgba(10,116,201,.07);
  --brand: linear-gradient(90deg, var(--red) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--blue) 66.6%);
  --slant: -11deg;
}
[data-theme=dark] { --paper: #0F141C; --grid: rgba(120,170,230,.06); }
body {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
h1, h2, h3, .display { font-style: italic; font-weight: 800; letter-spacing: -.02em; }
.card h3 { font-size: 17px; }
.card { border-radius: 10px; box-shadow: 0 1px 0 rgba(20,30,50,.08), 0 6px 16px -8px rgba(20,30,50,.12); }

.nav { box-shadow: none; border-bottom: 1px solid var(--line); }
.nav::after { height: 4px; }
.nav .links a { width: 70px; border-radius: 0; z-index: 0; }
.nav .links a.active { color: #fff; }
.nav .links a.active::before { content: ''; position: absolute; inset: 4px 6px; background: var(--blue); transform: skewX(var(--slant)); border-radius: 3px; z-index: -1; }
.nav .links a.active::after { display: none; }
.nav .search input { border-radius: 8px; }
.badge { border-radius: 4px; transform: skewX(var(--slant)); }
.btn { border-radius: 8px; }
.btn-primary { box-shadow: 3px 3px 0 var(--yellow); } .btn-primary:hover { box-shadow: 1px 1px 0 var(--yellow); transform: translate(2px,2px); }
.btn-primary:active { transform: translate(3px,3px); box-shadow: none; }
.chip { border-radius: 4px; }
.menu a { border-radius: 8px; } .menu a.active { background: transparent; color: var(--blue); box-shadow: inset 4px 0 0 var(--red); border-radius: 0 8px 8px 0; }

.post { position: relative; background-image: linear-gradient(90deg, transparent 0 46px, rgba(232,40,62,.55) 46px 47.5px, transparent 47.5px); }
.post-body { line-height: 1.65; }
.post .chip.q { background: linear-gradient(transparent 20%, var(--yellow) 20% 90%, transparent 90%); color: #2c2000; padding: 0 8px; border-radius: 0; transform: skewX(var(--slant)); font-weight: 700; }
.cm.best .bubble { box-shadow: inset 4px 0 0 #12997a; }
.cm .bubble { border-radius: 4px 14px 14px 14px; }
.media-grid { border-radius: 6px; } .poll-opt { border-radius: 6px; } .pa { border-radius: 6px; }
.embed { border-radius: 6px; border-left: 3px solid var(--yellow); }

.story .ring { background: conic-gradient(var(--red) 0 33%, var(--yellow) 0 66%, var(--blue) 0); }
.story .ring.seen { background: var(--line); }

.cover { background: var(--blue); overflow: hidden; background-size: cover; background-position: center; }
.cover:not([style*="url"])::before, .cover:not([style*="url"])::after { content: ''; position: absolute; top: 0; bottom: 0; transform: skewX(var(--slant)); }
.cover:not([style*="url"])::before { left: 8%; width: 22%; background: var(--red); }
.cover:not([style*="url"])::after { left: 34%; width: 16%; background: var(--yellow); }
.gcard .gcover { background: var(--blue); } .gcard:nth-child(3n+2) .gcover { background: var(--red); } .gcard:nth-child(3n) .gcover { background: var(--yellow); }
.gcard .gcover:not([style*="url"]) { background-image: none; }
.gcard { border-radius: 10px; }
.profile-head h1 { font-size: 26px; }
.tabs .active { border-bottom-color: var(--red); color: var(--ink); }
.modal { border-radius: 12px; }

.auth-hero { background: var(--blue); overflow: hidden; }
.auth-hero::before, .auth-hero::after { border-radius: 0; transform: skewX(var(--slant)); background: var(--red); width: 120px; height: 140%; top: -20%; right: 14%; left: auto; bottom: auto; }
.auth-hero::after { background: var(--yellow); width: 70px; right: 4%; }
.auth-hero img { width: 150px; background: #fff; padding: 8px 12px; border-radius: 8px; box-shadow: 6px 6px 0 rgba(0,0,0,.18); }
.auth-hero h1 { font-size: clamp(36px, 5.2vw, 68px); line-height: 1.02; font-weight: 900; text-shadow: none; max-width: 9em; }
.auth-hero p.lead { font-size: 18px; max-width: 28em; }
.auth-hero li::before { border-radius: 4px; transform: skewX(var(--slant)); background: var(--yellow); color: #2c2000; }
.auth-form { background: var(--paper); }
.auth-form form { background: var(--card); padding: 28px; border-radius: 10px; box-shadow: 6px 6px 0 var(--yellow), 0 0 0 1px var(--line); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 820px) { .auth-hero::before { right: 10%; width: 60px; } .auth-hero::after { right: 2%; width: 34px; } .post { background-image: linear-gradient(90deg, transparent 0 30px, rgba(232,40,62,.45) 30px 31px, transparent 31px); } }

/* ---------- Môn học, bảng, công thức ---------- */
.chip.subj { background: color-mix(in srgb, var(--sc) 13%, transparent); color: var(--sc); font-weight: 700; }
[data-theme=dark] .chip.subj { background: color-mix(in srgb, var(--sc) 28%, transparent); color: color-mix(in srgb, var(--sc) 55%, #fff); }
.post[style*="--sc"] { border-top: 4px solid var(--sc); }
.filters .chip.subj { border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent); background: var(--card); }
.filters .chip.subj.on { background: var(--sc); color: #fff; border-color: var(--sc); }
.tbl { overflow-x: auto; margin: 8px 0; white-space: normal; }
.tbl table { border-collapse: collapse; font-size: 14px; min-width: 60%; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
.tbl th { background: var(--blue-soft); }
.katex { font-size: 1.1em; } .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; background: var(--yellow-soft); border-radius: 4px; font-size: 13px; font-weight: 600; transform: skewX(-8deg); }
.badge-pill > * { transform: skewX(8deg); }
.hint { font-size: 12.5px; color: var(--muted); background: var(--hover); border-radius: 8px; padding: 8px 12px; }

/* ---------- Sửa lỗi hiển thị sau khi kiểm tra ---------- */
.post { background-image: linear-gradient(90deg, transparent 0 9px, rgba(232,40,62,.5) 9px 10.5px, transparent 10.5px); }
.post .post-main, .post .comments { padding-left: 26px; }
.post-actions { padding-left: 18px; }
.filters .chip { flex: none; white-space: nowrap; }
.profile-head .grow { margin-top: 54px; }
.profile-head h1 { color: var(--ink); }
.pa { white-space: nowrap; }
@media (max-width: 820px) {
  .post { background-image: linear-gradient(90deg, transparent 0 7px, rgba(232,40,62,.45) 7px 8.5px, transparent 8.5px); }
  .post .post-main, .post .comments { padding-left: 20px; padding-right: 12px; }
  .post-actions { padding-left: 12px; padding-right: 4px; }
  .pa { font-size: 12.5px; gap: 4px; padding: 8px 2px; }
  .profile-head .grow { margin-top: 0; flex-basis: 100%; }
}

/* =====================================================================
   Mobile-first hardening — học sinh dùng chủ yếu trên điện thoại
   ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; overflow-wrap: anywhere; }
.pa, .tool, .btn, .icon-btn, .tabbar a { touch-action: manipulation; }
.pa, .rx-pop button { -webkit-touch-callout: none; user-select: none; }
.auth { min-height: 100vh; min-height: 100dvh; }
@media (max-width: 820px) {
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; } /* mọi ô nhập ≥16px: iOS không tự phóng to */
  .btn { min-height: 42px; } .btn-sm { min-height: 38px; padding: 6px 14px; }
  .icon-btn { width: 44px; height: 44px; }
  .pa { min-height: 44px; }
  .composer .tool { min-height: 40px; padding: 8px 10px; }
  .composer select { min-height: 40px; }
  .menu a, .pop-menu button, .pop-menu a { min-height: 44px; }
  .chip.btn-like, .filters .chip { min-height: 36px; align-items: center; }
  .user-row { padding: 10px 0; }
  .nav { padding: 0 10px 0 12px; gap: 10px; padding-top: env(safe-area-inset-top); height: calc(var(--nav-h) + env(safe-area-inset-top)); }
  .nav .logo img { height: 32px; }
  .nav .search input { min-height: 40px; }
  .tabbar { padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { height: 52px; }
  .tabbar a.active { color: var(--blue); }
  .tabbar a.active::before { content: ''; position: absolute; top: -5px; left: 28%; right: 28%; height: 4px; background: var(--red); transform: skewX(-11deg); }
  .layout, .layout.two { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  /* Cửa sổ dạng bottom sheet */
  .modal-bg { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 88dvh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet .22s ease-out; }
  .stories { gap: 10px; } .story { width: 72px; }
  .cm .acts { gap: 14px; } .cm .acts button { min-height: 32px; }
  .cm-form textarea { font-size: 16px; }
  .replies { margin-left: 28px; }
  .profile-head { padding: 0 14px 12px; } .profile-head .av { --s: 84px !important; }
  .stats { gap: 16px; flex-wrap: wrap; }
  .auth-form { padding: 18px 14px 40px; align-items: start; } .auth-form form { padding: 20px 18px; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; } .gcard .gcover { height: 64px; }
  .media-grid, .media-grid img, .media-grid video { max-height: 420px; }
  .lightbox .nv { width: 44px; height: 44px; }
  /* Tin nhắn: chiếm toàn màn hình khi mở một cuộc trò chuyện */
  .toast-box { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: 92vw; } .toast { font-size: 13.5px; text-align: center; }
  .sv-box { width: 100vw; height: 100dvh; border-radius: 0; }
}
@media (max-width: 380px) { .grid-cards { grid-template-columns: 1fr; } .pa { font-size: 12px; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@media (hover: none) { .rx-wrap:hover .rx-pop { display: none; } .rx-wrap.open .rx-pop { display: block; } .rx-pop button:hover { transform: none; } }
@media (max-width: 820px) { .composer select, .composer textarea { font-size: 16px; } }

/* ---------- Đăng nhập bằng HVO ---------- */
.hvo-sso { gap: 10px; background: var(--card); color: var(--ink); border: 2px solid var(--blue); box-shadow: 3px 3px 0 var(--yellow); }
.hvo-sso:hover { background: var(--blue-soft); filter: none; }
.hvo-sso img { background: #fff; border-radius: 4px; padding: 1px 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Trình chỉnh ảnh đại diện / ảnh bìa (public/js/imgedit.js) */
.ie-stage { position: relative; margin: 0 auto; overflow: hidden; border-radius: 12px; background: #fff; border: 2px solid var(--line, #e5e7eb); touch-action: none; user-select: none; max-width: 100%; }
.ie-cv { display: block; cursor: grab; touch-action: none; }
.ie-cv:active { cursor: grabbing; }
.ie-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(10,15,25,.5); pointer-events: none; outline: 2px solid #fff; outline-offset: -2px; }
.ie-zoom { height: 40px; accent-color: var(--blue); }

/* ---------- HVO Cộng Đồng: giao diện ứng dụng ---------- */
:root {
  --paper: #F4F6FA; --radius: 20px; --nav-h: 76px;
  --shadow: 0 4px 24px -10px rgba(27,36,51,.12);
}
[data-theme=dark] { --paper: #0F141C; --shadow: 0 4px 24px -10px rgba(0,0,0,.4); }
body { background-image: none; letter-spacing: -.015em; }
h1, h2, h3, .display { font-style: normal; letter-spacing: -.035em; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
.btn { min-height: 40px; border-radius: 12px; padding: 9px 16px; transition: background .18s, transform .18s; }
.btn-primary, .btn-primary:hover, .hvo-sso { box-shadow: none; }
.btn-primary:hover { transform: none; }
.btn:active, .icon-btn:active { transform: scale(.96); }
.btn-sm { padding: 7px 12px; }
.btn-block { min-height: 48px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flush, .post { padding: 0; }
.nav { padding: 0 max(24px, calc((100vw - 1280px) / 2)); gap: 22px; box-shadow: 0 1px 12px rgba(27,36,51,.03); }
.nav::after { display: none; }
.nav .logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; color: var(--ink); text-decoration: none; }
.nav .logo img { height: 31px; border-radius: 0; }
[data-theme=dark] .nav .logo img { border-radius: 6px; padding: 2px 4px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy b { font-size: 22px; letter-spacing: -.06em; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.brand-dot { width: 6px; height: 6px; background: var(--red); border-radius: 50%; align-self: flex-end; margin-bottom: 5px; }
.brand-copy > span { font-size: 10px; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.nav .search { flex-basis: 290px; }
.nav .search input { border-radius: 14px; padding-top: 12px; padding-bottom: 12px; }
.nav .search svg { top: 13px; }
.nav .links { gap: 8px; }
.nav .links a { width: 52px; height: 48px; border-radius: 14px; }
.nav .links a.active { background: var(--blue-soft); color: var(--blue); }
.nav .links a.active::before { display: none; }
.account-btn { background: var(--hover); width: 46px; height: 46px; flex-shrink: 0; }
.mobile-search { display: none; }
.badge { border-radius: 999px; transform: none; box-shadow: 0 0 0 2px var(--card); }
.layout { max-width: 1280px; grid-template-columns: 232px minmax(0, 1fr) 290px; gap: 24px; padding-top: 28px; }
.layout.two { grid-template-columns: 232px minmax(0, 1fr); }
.side { top: calc(var(--nav-h) + 28px); gap: 20px; }
.menu { border: 0; background: transparent; box-shadow: none; }
.menu a { min-height: 48px; padding: 12px; font-size: 14px; gap: 12px; border-radius: 14px; margin: 3px 0; }
.menu a.active { border-radius: 14px; box-shadow: none; background: var(--blue-soft); color: var(--blue); }
.menu a:first-child { background: var(--card); border: 1px solid var(--line); margin-bottom: 16px; min-height: 64px; }
.menu .sep { margin: 14px 6px; }
.footer-note { padding: 0 12px; font-size: 11px; line-height: 1.8; }
.hvo-home-link { display: inline-block; color: var(--muted); font-size: 11px; }
.hvo-home-link:hover, .hvo-home-link:focus-visible { color: var(--blue); text-decoration: underline; }
.pop-menu a.compact { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0; min-height: 44px; color: var(--muted); font-size: 11px; }
.pop-menu a.compact:hover, .pop-menu a.compact:focus-visible { color: var(--blue); }
.right .card h3 { font-size: 16px; margin-bottom: 16px; }
.right .user-row { gap: 8px; flex-wrap: wrap; padding: 12px 0; }
.right .user-row .btn { margin-left: 48px; }
.right .user-row .meta { min-width: 140px; }
.feed-welcome { position: relative; overflow: hidden; border-radius: 22px; background: var(--blue); color: #fff; padding: 26px; min-height: 186px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.welcome-copy { position: relative; z-index: 1; }
.eyebrow { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px; opacity: .8; }
.feed-welcome h1 { font-size: clamp(25px, 2.4vw, 32px); line-height: 1.25; font-weight: 800; }
.feed-welcome h1 span { color: #FFE08B; }
.feed-welcome p { font-size: 12px; margin-top: 12px; opacity: .85; }
.welcome-mark { width: 100px; height: 112px; flex: none; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; background: var(--yellow); color: #243B59; border-radius: 16px 16px 32px 16px; transform: rotate(9deg); box-shadow: 8px 8px 0 rgba(0,0,0,.12); }
.welcome-mark svg.i { width: 46px; height: 46px; stroke-width: 1.5; }
.welcome-mark span { font-size: 13px; font-weight: 800; letter-spacing: .16em; }
.learning-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.learning-shortcuts a { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: none; }
.learning-shortcuts a > svg { width: 12px; height: 12px; margin-left: auto; color: var(--muted); }
.shortcut-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; }
.shortcut-icon.yellow { background: var(--yellow-soft); color: #946600; }
.shortcut-icon.blue { background: var(--blue-soft); color: var(--blue); }
.shortcut-icon.red { background: var(--red-soft); color: var(--red); }
.feed-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.feed-heading h2 { font-size: 18px; }
.feed-heading > span { font-size: 11px; color: var(--muted); }
.filters { padding: 0 0 3px; gap: 8px; }
.filters .chip, .chip { border-radius: 999px; }
.filters .chip { min-height: 36px; padding: 7px 14px; font-size: 12px; }
.filters .chip.subj { border-color: var(--line); }
.story .add { border: 1px dashed var(--blue); }
.composer .tools { gap: 6px; }
.composer .tool { padding: 8px; font-size: 12px; }
.composer .tool[data-k=media] { color: #12997a; }
.composer .tool[data-k=question] { color: var(--blue); }
.composer .tool[data-k=poll] { color: #9a6a00; }
.composer select { background: var(--hover); border-color: transparent; }
.post { background-image: none; overflow: visible; }
.post .post-main { padding: 18px 20px 8px; }
.post .comments { padding-left: 20px; }
.post-head { align-items: center; }
.post-head .who { line-height: 1.5; }
.post-head .sub { font-size: 11px; }
.post-body { font-size: 14px; line-height: 1.8; margin: 15px 0 12px; }
.post[style*="--sc"] { border-top-width: 3px; }
.post .chip.q { background: var(--yellow-soft); border-radius: 6px; transform: none; padding: 2px 7px; font-weight: 600; }
.post-actions { margin: 0 16px; padding: 6px 0; gap: 2px; }
.pa { min-height: 42px; font-size: 12px; }
.post-stats { font-size: 12px; padding-bottom: 10px; }
.media-grid { border-radius: 14px; }
.embed, .poll-opt, .file-att { border-radius: 14px; }
.tabs { border-top: 0; padding: 6px; gap: 4px; }
.tabs a, .tabs button { padding: 10px 14px; border-radius: 12px; border-bottom: 0; font-size: 13px; }
.tabs .active { background: var(--blue-soft); color: var(--blue); }
.gcard { overflow: hidden; border-radius: 20px; padding: 0; }
.gcard .gcover { height: 110px; border-radius: 0; }
.gcard .gbody { padding: 16px; gap: 10px; }
.profile-head h1 { letter-spacing: -.04em; }
.pop-menu { border-radius: 18px; padding: 6px; box-shadow: 0 12px 40px rgba(27,36,51,.18); border: 1px solid var(--line); }
.pop-menu button { border-radius: 12px; padding: 12px; }
.modal { border-radius: 24px; padding: 24px; }
.modal-bg { background: rgba(15,24,40,.45); backdrop-filter: blur(4px); }
.modal h2 { font-size: 22px; }
.auth-hero { gap: 24px; }
.auth-form form { padding: 32px; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-form { background: var(--paper); }
.auth-form .field { margin-bottom: 18px; }
.auth-form input { min-height: 50px; background: var(--hover); border-color: transparent; }
.auth-form h2 { font-size: 28px; }
.hvo-sso { border-width: 1px; background: var(--blue-soft); }
@media (max-width: 1100px) and (min-width: 821px) {
  .layout, .layout.two { grid-template-columns: 210px minmax(0, 1fr); }
  .nav { padding: 0 20px; gap: 16px; }
  .nav .search { flex-basis: 210px; }
  .brand-copy > span { display: none; }
}
@media (max-width: 820px) {
  :root { --nav-h: 66px; --tab-h: 72px; --radius: 20px; }
  body { font-size: 14px; }
  .nav { padding: env(safe-area-inset-top) 18px 0; height: calc(var(--nav-h) + env(safe-area-inset-top)); gap: 10px; }
  .nav .logo { margin-right: auto; gap: 8px; }
  .nav .logo img { height: 28px; }
  .brand-copy b { font-size: 18px; }
  .brand-copy > span { font-size: 10px; margin-top: 2px; }
  .mobile-search { display: inline-grid; color: var(--ink); background: var(--hover); flex-shrink: 0; }
  .account-btn { background: transparent; width: 40px; }
  .nav .search { display: none; position: absolute; left: 14px; right: 14px; top: calc(100% + 8px); padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
  .nav.search-open .search { display: block; }
  .nav .search input { min-height: 48px; border-radius: 12px; padding-left: 40px; }
  .nav .search svg { top: 22px; left: 21px; }
  .layout, .layout.two, .layout.one { grid-template-columns: minmax(0, 1fr); padding: 16px 14px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); gap: 16px; }
  #center { gap: 14px !important; }
  .card { padding: 16px; box-shadow: 0 3px 16px -10px rgba(27,36,51,.12); }
  .card.flush, .post, .gcard { padding: 0; }
  .feed-welcome { border-radius: 22px; min-height: 172px; padding: 22px; gap: 10px; }
  .feed-welcome h1 { font-size: 25px; }
  .feed-welcome p { font-size: 11px; max-width: 190px; }
  .eyebrow { font-size: 9px; letter-spacing: .12em; }
  .welcome-mark { width: 72px; height: 90px; border-radius: 12px 12px 24px 12px; }
  .welcome-mark svg.i { width: 34px; height: 34px; }
  .welcome-mark span { font-size: 10px; }
  .learning-shortcuts { gap: 8px; }
  .learning-shortcuts a { gap: 6px; padding: 10px 8px; font-size: 11px; border-radius: 14px; }
  .learning-shortcuts a > svg { display: none; }
  .shortcut-icon { width: 28px; height: 30px; border-radius: 9px; }
  .shortcut-icon svg.i { width: 18px; height: 18px; }
  .feed-heading { margin-top: 4px; }
  .feed-heading h2 { font-size: 17px; }
  .feed-heading > span { font-size: 10px; }
  .stories { gap: 12px; }
  .story { font-size: 11px; width: 66px; }
  .story .ring, .story .add { width: 62px; height: 62px; }
  .story .ring .av { --s: 54px !important; }
  .composer textarea { height: 44px; min-height: 44px; padding: 11px 0; font-size: 16px; }
  .composer.is-expanded textarea { min-height: 94px; }
  .composer .tools { justify-content: space-between; gap: 4px; margin-top: 12px; padding-top: 10px; }
  .composer:not(.is-expanded) .tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .composer:not(.is-expanded) .tool { flex-direction: column; font-size: 10px; gap: 5px; padding: 5px 0; }
  .composer .tool { font-size: 11px; gap: 5px; min-height: 40px; padding: 6px 4px; }
  .composer .tool svg { width: 18px; height: 18px; }
  .composer:not(.is-expanded) .tools > select, .composer:not(.is-expanded) .tools > .btn, .composer:not(.is-expanded) .tools > .grow { display: none; }
  .composer.is-expanded .tools > .grow { flex-basis: 100%; height: 0; }
  .composer .tools select { min-width: 0; max-width: 40%; padding: 8px 6px; font-size: 16px; }
  .composer .tools [data-k=send] { margin-left: auto; min-width: 58px; }
  .post .post-main { padding: 16px 16px 6px; }
  .post .comments { padding: 0 12px 12px; }
  .post-body { font-size: 14px; line-height: 1.75; }
  .post-head .av { --s: 40px !important; }
  .post-head .uname { font-size: 13px; }
  .post-actions { margin: 0 10px; padding: 4px 0; }
  .pa { min-height: 44px; font-size: 11px; gap: 4px; padding: 8px 2px; }
  .pa svg.i { width: 18px; height: 18px; }
  .filters { margin-right: -14px; padding-right: 14px; }
  .filters .chip { min-height: 36px; font-size: 11px; padding: 7px 12px; }
  .tabbar { height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); gap: 2px; border-top: 1px solid var(--line); box-shadow: 0 -4px 24px rgba(27,36,51,.04); }
  .tabbar a { min-width: 0; height: 58px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; border-radius: 14px; text-decoration: none; }
  .tab-icon { position: relative; width: 46px; height: 30px; display: grid; place-items: center; border-radius: 12px; transition: background .18s; }
  .tabbar a svg.i { width: 22px; height: 22px; stroke-width: 1.8; }
  .tab-label { font-size: 9px; font-weight: 600; white-space: nowrap; letter-spacing: -.02em; }
  .tabbar a.active .tab-icon { color: var(--blue); background: var(--blue-soft); }
  .tabbar a.active .tab-label { color: var(--blue); font-weight: 700; }
  .tabbar a.active::before { display: none; }
  .tabbar a .badge { right: -1px; top: -3px; font-size: 9px; min-width: 16px; height: 16px; }
  .modal-bg { padding: 0; }
  .modal { border-radius: 28px 28px 0 0; padding: 26px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 90dvh; }
  .modal::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 99px; background: var(--line); margin: -14px auto 20px; }
  .modal h2 { font-size: 20px; }
  .pop-menu { max-width: calc(100vw - 24px); }
  .grid-cards { gap: 12px; }
  .gcard .gcover { height: 90px; }
  .gcard .gbody { padding: 12px; }
  .profile-head { padding: 0 16px 16px; }
  .profile-head h1 { font-size: 24px; }
  .auth { background: var(--card); }
  .auth-hero { padding: calc(32px + env(safe-area-inset-top)) 24px 28px; gap: 16px; border-radius: 0 0 32px 32px; }
  .auth-hero img { width: 112px; padding: 6px 10px; border-radius: 10px; box-shadow: none; }
  .auth-hero h1 { font-size: 34px; max-width: 9em; line-height: 1.15; }
  .auth-hero p.lead { font-size: 13px; line-height: 1.7; max-width: 25em; }
  .auth-form { padding: 28px 22px calc(32px + env(safe-area-inset-bottom)); background: var(--card); }
  .auth-form form { padding: 0; box-shadow: none; border: 0; border-radius: 0; width: min(440px, 100%); }
  .auth-form h2 { font-size: 25px; }
  .auth-form .field { margin-bottom: 16px; }
  .toast-box { bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .nav { padding-left: 14px; padding-right: 14px; gap: 8px; }
  .nav .logo img { height: 24px; }
  .brand-copy b { font-size: 17px; }
  .feed-welcome { padding: 18px; }
  .feed-welcome h1 { font-size: 23px; }
  .welcome-mark { width: 58px; height: 80px; }
  .tab-label { font-size: 8px; }
  .learning-shortcuts a { font-size: 10px; gap: 4px; }
  .composer .tool { font-size: 10px; }
}
@media (hover: hover) {
  .learning-shortcuts a:hover { border-color: var(--blue); background: var(--blue-soft); }
}

/* ---------- Story: thẻ xem trước và trình xem toàn màn hình ---------- */
.stories-section { padding: 18px; overflow: hidden; }
.stories-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.stories-heading > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.stories-heading h2 { font-size: 18px; }
.stories-heading span { font-size: 11px; color: var(--muted); }
.story-scroll-controls { display: flex; gap: 4px; }
.story-scroll-controls .icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); }
.story-scroll-controls .icon-btn:disabled { opacity: .3; cursor: default; }
.stories-section .stories { gap: 10px; padding: 3px 2px 6px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.stories-section .story { position: relative; width: 118px; height: 184px; flex: 0 0 118px; border-radius: 16px; overflow: hidden; scroll-snap-align: start; text-align: left; background: var(--blue); isolation: isolate; transition: transform .18s; }
.stories-section .story span { white-space: normal; }
.stories-section .av { display: inline-grid !important; }
.story-cover, .story-text-preview { position: absolute; inset: 0; width: 100%; height: 100%; }
.story-cover { object-fit: cover; }
.story-text-preview { display: flex !important; align-items: center; justify-content: center; padding: 48px 10px 44px; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.story-shade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.16), transparent 35%, rgba(0,0,0,.62)); pointer-events: none; }
.story-avatar { position: absolute; top: 10px; left: 10px; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%; padding: 1px; display: grid !important; place-items: center; background: var(--blue); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.story-avatar .av-wrap { display: flex; }
.story-avatar .av { --s: 30px !important; }
.story-tile.unseen .story-avatar { border-color: var(--yellow); }
.story-tile.seen .story-avatar { border-color: #D4DBE4; background: #6B7686; }
.story-tile-label { position: absolute; bottom: 12px; left: 10px; right: 10px; color: #fff; line-height: 1.35; }
.story-tile-label b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; font-weight: 700; }
.story-tile-label > span { display: block; font-size: 9px; opacity: .85; margin-top: 3px; }
.story-video { position: absolute; top: 12px; right: 9px; color: #fff; }
.story-video svg { width: 16px; height: 16px; fill: rgba(255,255,255,.2); }
.stories-section .story-create { background: var(--card); border: 1px solid var(--line); }
.story-create-art { position: absolute; inset: 0 0 52px; background: var(--blue-soft); display: grid !important; place-items: center; }
.story-create-art > .av-wrap { display: inline-flex; z-index: 1; border: 5px solid var(--card); border-radius: 50%; box-shadow: 0 4px 12px rgba(10,116,201,.1); }
.story-create-pattern { position: absolute; right: -9px; top: 8px; color: var(--blue); opacity: .12; transform: rotate(15deg); }
.story-create-pattern svg { width: 70px; height: 70px; stroke-width: 1; }
.story-create-plus { position: absolute; left: calc(50% - 17px); bottom: 36px; border: 3px solid var(--card); width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid !important; place-items: center; }
.story-create-plus svg { width: 18px; height: 18px; }
.story-create-label { position: absolute; bottom: 9px; left: 5px; right: 5px; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink); }
.story-create-label > span { display: block; font-size: 8px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.stories-empty { flex: 1; min-width: 140px; align-self: center; padding: 10px 8px 10px 18px; color: var(--ink); }
.stories-empty-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--blue); background: var(--blue-soft); border-radius: 12px; margin-bottom: 10px; }
.stories-empty b { display: block; font-size: 17px; line-height: 1.4; letter-spacing: -.025em; }
.stories-empty p { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.7; }
.story-privacy { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 11px; color: var(--muted); }
/* Keep story actions visible while the settings scroll, including short phones. */
.story-composer .story-editor { display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(90dvh, 850px); padding: 0; overflow: hidden; }
.story-editor::before { display: none; }
.story-editor-header { flex: none; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.story-editor-header h2 { margin: 0; }
.story-editor-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
.story-editor-footer { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.story-editor-footer .story-privacy { flex: 1; margin: 0; flex-wrap: nowrap; }
.story-editor-footer .story-privacy svg { flex: none; }
.story-editor-footer .btn { flex: none; }
.story-file-row { display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; }
.story-file-row .btn { flex: none; cursor: pointer; }
#story-file-name { min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
.story-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.story-file-input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 3px; }
.story-upload-preview { width: 100%; height: clamp(140px, 27dvh, 240px); background: #1B2433; border-radius: 12px; overflow: hidden; }
.story-upload-preview img, .story-upload-preview video { display: block; width: 100%; height: 100%; object-fit: contain; }
.story-editor input[type=date] { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.story-editor #aud { min-width: 0; }
.story-editor [hidden] { display: none !important; }
@media (max-width: 820px) {
  .story-composer .story-editor { max-height: 94dvh; }
  .story-editor-header, .story-editor-body { padding: 12px 16px; }
  .story-editor-footer { padding-left: 16px; padding-right: 16px; }
  .story-file-row { flex-wrap: wrap; }
  #story-file-name { flex-basis: 100%; }
  .story-editor-footer .story-privacy { font-size: 10px; }
}
.story-privacy svg { width: 16px; height: 16px; }
.swatches button { width: 36px; height: 36px; }
.story-viewing { overflow: hidden; }
.sv { background: rgba(8,12,20,.95); overscroll-behavior: none; outline: none; }
.sv-box { width: min(420px, 100vw); height: min(820px, 94dvh); border-radius: 22px; }
.sv-content { position: absolute; inset: 0; display: grid; place-items: center; }
.sv-content img:not(.av), .sv-content video { width: 100%; height: 100%; object-fit: contain; }
.sv-text { padding: 110px 30px 90px; font-size: clamp(24px, 5vw, 34px); line-height: 1.5; white-space: pre-wrap; }
.sv-bars { top: 12px; left: 12px; right: 12px; gap: 5px; z-index: 5; }
.sv-bars i { height: 3px; background: rgba(255,255,255,.3); }
.sv-bars b { background: #fff; }
.sv-head { top: 25px; left: 12px; right: 10px; gap: 9px; z-index: 5; align-items: center; }
.sv-head::before { content: ''; position: absolute; inset: -25px -12px -26px; background: linear-gradient(rgba(0,0,0,.55), transparent); z-index: -1; pointer-events: none; }
.sv-head .av { width: 36px; height: 36px; }
.sv-head b { font-size: 12px; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sv-time { display: block; font-size: 10px; opacity: .8; margin-top: 2px; }
.sv-head .icon-btn, .sv-footer .icon-btn { width: 36px; height: 40px; flex-shrink: 0; color: #fff; }
.sv .icon-btn:hover { color: #fff; background: rgba(255,255,255,.15); }
.sv-nav { top: 88px; bottom: 76px; width: 50%; touch-action: none; -webkit-touch-callout: none; user-select: none; }
.sv-nav:focus-visible { outline-offset: -4px; }
.sv-footer { position: absolute; bottom: 12px; left: 18px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; z-index: 5; font-size: 11px; color: rgba(255,255,255,.8); }
.sv-cap { bottom: 65px; padding: 28px 20px 16px; font-size: 14px; line-height: 1.6; pointer-events: none; }
.sv-status { position: absolute; padding: 24px; text-align: center; font-size: 13px; color: #fff; }
.sv-status:empty { display: none; }
@media (hover: hover) { .stories-section .story:hover { transform: translateY(-2px); } }
@media (max-width: 820px) {
  .stories-section { padding: 16px 12px 12px; }
  .stories-heading { margin-bottom: 12px; padding: 0 2px; }
  .stories-heading h2 { font-size: 16px; }
  .stories-heading span { font-size: 10px; }
  .story-scroll-controls { display: none; }
  .stories-section .stories { gap: 9px; margin-right: -12px; padding-right: 12px; }
  .stories-section .story { width: 108px; flex-basis: 108px; height: 170px; border-radius: 14px; }
  .story-text-preview { font-size: 13px; }
  .stories-empty { padding-left: 12px; }
  .stories-empty b { font-size: 15px; }
  .stories-empty p { font-size: 10px; }
  .sv-box { width: 100%; height: 100dvh; border-radius: 0; }
  .sv-bars { top: calc(10px + env(safe-area-inset-top)); }
  .sv-head { top: calc(23px + env(safe-area-inset-top)); }
  .sv-head .icon-btn { width: 40px; height: 44px; }
  .sv-nav { top: calc(88px + env(safe-area-inset-top)); bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sv-footer { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .sv-cap { bottom: calc(65px + env(safe-area-inset-bottom)); }
  .sv-text { padding-top: calc(110px + env(safe-area-inset-top)); }
  .story-privacy { flex-wrap: wrap; }
}

/* Chỉnh sửa/bộ sưu tập/gợi ý tìm kiếm */
.linkish { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; }
.search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line, #e5e7eb); border-radius: 12px; box-shadow: 0 12px 32px rgba(10,15,25,.18); z-index: 120; overflow: hidden; max-height: 70vh; overflow-y: auto; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 44px; color: var(--ink); text-decoration: none; }
.suggest a:hover, .suggest a:focus { background: var(--bg-soft, rgba(10,116,201,.08)); }
.suggest small { display: block; color: var(--muted, #6b7280); font-size: 12px; }
.sg-ico { width: 28px; height: 28px; display: grid; place-items: center; font-weight: 800; background: var(--bg-soft, #eef2f7); border-radius: 50%; }

.vid-wait { display: grid; place-items: center; text-align: center; min-height: 120px; padding: 16px; border-radius: 12px; background: var(--hover, #eef2f7); color: var(--muted, #6b7280); font-weight: 600; }

/* Tìm kiếm: ô nhập riêng, loại nội dung cuộn ngang, bộ lọc trên điện thoại. */
.search-panel h1{font-size:28px;margin:0}.search-panel .row p{margin-top:5px}.search-emblem{width:52px;height:52px;display:grid;place-items:center;border-radius:18px;background:var(--blue-soft);color:var(--blue)}
.search-field{display:flex;align-items:center;gap:10px;margin-top:20px;padding:7px 7px 7px 14px;border:1px solid var(--line);border-radius:16px;background:var(--bg)}.search-field>.i{flex:none;color:var(--muted)}.search-field input{border:0;background:transparent;box-shadow:none;min-width:0;flex:1;font-size:16px;padding:10px 0}.search-field .btn{flex:none}
.search-categories{display:flex;gap:8px;overflow-x:auto;margin:18px -4px 0;padding:4px;scrollbar-width:none}.search-categories a{display:flex;align-items:center;gap:7px;white-space:nowrap;flex:none;padding:10px 13px;border-radius:12px;color:var(--muted);font-size:13px;font-weight:700}.search-categories a.on{background:var(--blue-soft);color:var(--blue)}
.search-filters{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}.search-filters label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:12px;flex:1;min-width:130px}.search-filters select{width:100%;font-size:16px;padding:9px}
.search-section{margin:20px 0}.search-section h2{font-size:17px;margin:0 0 12px}.search-section>.post{margin-bottom:14px}.search-recents{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.search-recents a{display:flex;align-items:center;gap:7px;background:var(--hover);border-radius:12px;padding:10px 13px;color:var(--ink);font-size:14px}.search-more{margin:20px 0;min-height:48px}
@media(max-width:540px){.search-panel{padding:18px 14px}.search-panel h1{font-size:24px}.search-emblem{width:44px;height:44px;border-radius:14px}.search-field{gap:7px;padding-left:10px}.search-field input{font-size:16px}.search-field .btn{padding:10px 14px}.search-filters label{min-width:calc(50% - 10px)}.search-categories a{padding:10px 12px}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---------- Chuỗi trả lời kiểu Threads: đường kẻ dọc, thu gọn/mở ---------- */
.replies { margin-left: 16px; padding-left: 10px; border-left: 2px solid var(--line); }
.cm.collapsed > .grow > .replies { display: none; }
.cm-toggle { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cm-toggle:hover .cm-toggle-text { text-decoration: underline; }
.cm-toggle-line { width: 18px; height: 2px; background: var(--line); border-radius: 2px; }
.cm[data-depth="2"] > .grow > .replies, .cm[data-depth="3"] > .grow > .replies { margin-left: 8px; padding-left: 8px; }
.cm .grow { min-width: 0; }
@media (max-width: 820px) {
  .replies { margin-left: 12px; padding-left: 8px; }
  .cm-toggle { min-height: 40px; }
}

/* ---------- Khoảnh khắc: ảnh vuông gửi riêng cho bạn bè / nhóm học ---------- */
.moments-section { padding: 18px; overflow: hidden; }
.moments { display: flex; gap: 10px; overflow-x: auto; padding: 3px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.moment { position: relative; flex: 0 0 96px; width: 96px; height: 96px; border-radius: 22px; overflow: hidden; scroll-snap-align: start; text-align: left; }
.moment-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--blue); color: var(--blue); background: var(--blue-soft); font-size: 12px; }
.moment-add-art svg { width: 26px; height: 26px; }
.moment-tile { padding: 0; border: 3px solid var(--line); background: var(--hover); }
.moment-tile.unseen { border-color: var(--yellow); }
.moment-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.moment-shade { position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.6)); pointer-events: none; }
.moment-av { position: absolute; top: 5px; left: 5px; display: flex; border: 2px solid #fff; border-radius: 50%; }
.moment-label { position: absolute; left: 7px; right: 7px; bottom: 6px; color: #fff; line-height: 1.25; }
.moment-label b, .moment-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moment-label b { font-size: 11px; } .moment-label span { font-size: 9px; opacity: .85; }
.moments-empty { align-self: center; flex: 1; min-width: 180px; font-size: 12px; color: var(--muted); line-height: 1.6; padding-left: 6px; }
.moment-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.moment-pick .btn { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.moment-pick.compact { display: none; }
.moment-preview img { display: block; width: 100%; max-width: 320px; aspect-ratio: 1; object-fit: cover; border-radius: 20px; margin: 0 auto; }
.mv { position: fixed; inset: 0; z-index: 200; background: #0A0E16; display: grid; place-items: center; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.mv-box { width: min(440px, 100vw); max-height: 100dvh; display: flex; flex-direction: column; gap: 12px; padding: 12px; color: #fff; }
.mv-head { display: flex; align-items: center; gap: 10px; }
.mv-head .grow { min-width: 0; } .mv-head b { display: block; } .mv-head span { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 4px; } .mv-head svg { width: 12px; height: 12px; }
.mv-count { font-size: 12px; opacity: .7; }
.mv-head .icon-btn { color: #fff; width: 44px; height: 44px; }
.mv-photo { position: relative; width: 100%; aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: #000; }
.mv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-cap { position: absolute; left: 12px; right: 12px; bottom: 14px; padding: 8px 14px; border-radius: 16px; background: rgba(0,0,0,.55); text-align: center; font-weight: 700; word-break: break-word; }
.mv-nav { position: absolute; top: 0; bottom: 0; width: 38%; } .mv-nav.l { left: 0; } .mv-nav.r { right: 0; }
.mv-foot { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mv-emojis { display: flex; gap: 8px; justify-content: center; }
.mv-emojis button { width: 52px; height: 52px; border-radius: 50%; font-size: 26px; background: rgba(255,255,255,.12); display: grid; place-items: center; transition: transform .15s; }
.mv-emojis button.on { background: var(--yellow); transform: scale(1.12); }
.mv-safety { display: flex; gap: 8px; }
.mv-safety .btn, .mv-foot > .btn { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; min-height: 40px; }
.mv-replies { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 12px; text-align: center; }
.mv-reply { position: relative; display: inline-flex; } .mv-reply i { position: absolute; right: -6px; bottom: -6px; font-style: normal; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .mv-emojis button { transition: none; } }
@media (max-width: 820px) { .moments-section { padding: 14px; } .mv-box { height: 100dvh; justify-content: center; } }
body.story-viewing .modal-bg { z-index: 260; } /* hộp Báo cáo/Chặn/Xóa mở từ trình xem phải nằm trên trình xem */

/* ---------- Ghi chú trạng thái ---------- */
.notes-section { padding: 18px; overflow: hidden; }
.notes { display: flex; gap: 14px; overflow-x: auto; padding: 36px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.note { position: relative; flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-align: center; scroll-snap-align: start; min-height: 44px; }
.note b { font-size: 11px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-bubble { position: absolute; bottom: calc(100% - 44px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 104px; padding: 6px 9px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sc, var(--line)); box-shadow: 0 2px 6px rgba(27,36,51,.1); font-size: 11px; line-height: 1.35; font-weight: 600; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; z-index: 1; }
.note-bubble small { display: block; font-size: 9px; font-weight: 700; color: var(--sc, var(--muted)); margin-top: 2px; }
.note-bubble.note-empty { color: var(--muted); font-weight: 500; border-style: dashed; border-left-style: dashed; }
.note-close { display: inline-flex; vertical-align: -2px; margin-right: 3px; color: #12997a; } .note-close svg { width: 11px; height: 11px; fill: currentColor; }
.note .av-wrap { margin-top: 0; }
.close-list { max-height: 50vh; overflow-y: auto; }
.close-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; min-height: 52px; cursor: pointer; }
.close-row small { display: block; color: var(--muted); font-size: 12px; }
.close-row input { width: 22px; height: 22px; accent-color: #12997a; flex: none; }

/* ---------- Story: kiểu chữ, vòng bạn thân, sticker ---------- */
.story-tile.close .story-avatar { border-color: #12997a; }
.story-tile.close.unseen { box-shadow: 0 0 0 2px #12997a; }
.hl { background: var(--yellow); color: #1B2433; padding: .05em .3em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.sv-text.notebook, .story-text-preview.notebook { color: #1B2433 !important; text-align: left; justify-content: flex-start;
  background-image: linear-gradient(90deg, transparent 38px, #E8283E 38px 40px, transparent 40px), repeating-linear-gradient(transparent 0 35px, #cfe0f1 35px 36px); }
.sv-text.notebook { padding-left: 56px; line-height: 36px; font-family: 'Be Vietnam Pro', sans-serif; font-weight: 600; }
.story-text-preview.notebook { padding-left: 22px; background-size: auto, 100% 20px; font-size: 12px; }
.sv-cap.marker .hl { font-weight: 700; }
.chip.style-marker { background: var(--yellow); color: #1B2433; } .chip.style-notebook { background: #FFFDF5; border: 1px solid #E8283E; color: #1B2433; }
.chip.on { outline: 2px solid var(--blue); }
.quiz-opt { display: flex; align-items: center; gap: 8px; } .quiz-opt input[type=radio] { width: 22px; height: 22px; accent-color: #12997a; flex: none; }
.sv-sticker { position: absolute; left: 14px; right: 14px; top: 46%; z-index: 4; }
.sv-box.has-sk .sv-text { place-items: start center; padding-top: calc(100px + env(safe-area-inset-top)); }
.sk { background: #fff; color: #1B2433; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.28); text-align: center; }
.sk b { font-size: 16px; line-height: 1.35; word-break: break-word; }
.sk small { font-size: 12px; color: #6B7686; }
.sk-tag { align-self: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--yellow); color: #1B2433; border-radius: 6px; padding: 2px 8px; transform: skewX(-11deg); }
.sk-opt { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 2px solid #D4DBE4; background: #fff; font-weight: 600; color: #1B2433; text-align: left; }
.sk-opt i { position: absolute; inset: 0 auto 0 0; background: rgba(10,116,201,.18); transition: width .4s ease; }
.sk-opt span, .sk-opt em { position: relative; } .sk-opt em { font-style: normal; font-weight: 800; }
.sk-opt.sel { border-color: var(--blue); } .sk-opt.right { border-color: #12997a; } .sk-opt.right i { background: rgba(18,153,122,.25); } .sk-opt.wrong { border-color: var(--red); } .sk-opt.wrong i { background: rgba(232,40,62,.2); }
.sk-opt:disabled { opacity: 1; cursor: default; }
.sk-qa { align-items: stretch; } .sv-qa-input { font-size: 16px; border: 2px solid #D4DBE4; border-radius: 12px; padding: 10px 12px; color: #1B2433; background: #fff; }
.sk-count strong { font-size: 44px; line-height: 1; color: var(--red); font-style: italic; }
@media (prefers-reduced-motion: reduce) { .sk-opt i { transition: none; } }

/* ---------- Chuyển động có chủ đích (tắt khi người dùng chọn giảm chuyển động) ---------- */
html { overscroll-behavior-y: contain; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes view-slide { from { opacity: 0; transform: translateX(28px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.38) rotate(-8deg); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes heart { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.25); } 60% { transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
#main.view-in { animation: view-in .22s ease-out; }
#main.view-slide { animation: view-slide .24s cubic-bezier(.2,.8,.2,1); }
.pa.bounce > span:first-child, .pa.bounce > svg { animation: pop .45s ease; display: inline-block; }
.av-wrap .av { transition: box-shadow .3s ease; }
.story-tile .story-avatar { transition: border-color .3s ease, background-color .3s ease; }
.story-tile { transition: opacity .3s ease, box-shadow .3s ease; }
.story-tile.seen { opacity: .86; }
@media (prefers-reduced-motion: reduce) {
  #main.view-in, #main.view-slide, .pa.bounce > *, .lb-heart.show, .comments.sheet, .skel i { animation: none !important; }
  .av-wrap .av, .story-tile, .story-tile .story-avatar, .comments.sheet, .ptr { transition: none !important; }
}

/* ---------- Skeleton (thay vòng quay) ---------- */
.skel { display: flex; flex-direction: column; gap: 12px; padding: 14px 4px; }
.skel-row { display: flex; align-items: center; gap: 10px; }
.skel i { display: block; background: linear-gradient(90deg, var(--hover) 25%, var(--line) 50%, var(--hover) 75%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 8px; }
.skel-av { width: 40px; height: 40px; border-radius: 50% !important; flex: none; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; } .skel-lines i { height: 11px; } .skel-lines i:last-child { width: 55%; }
.skel-block { height: 110px; border-radius: 12px !important; }
.modal .skel, .user-row .skel { padding: 4px 0; } .modal .skel-block { height: 60px; }

/* ---------- Kéo xuống để làm mới ---------- */
.ptr { position: fixed; top: calc(env(safe-area-inset-top) + 56px); left: 50%; width: 38px; height: 38px; margin-left: 0; border-radius: 50%; background: var(--card); box-shadow: 0 2px 10px rgba(27,36,51,.2); display: grid; place-items: center; z-index: 120; opacity: 0; transform: translate(-50%, 0); transition: opacity .15s; pointer-events: none; color: var(--muted); }
.ptr svg { width: 20px; height: 20px; transform: rotate(-90deg); transition: transform .2s; }
.ptr.ready { color: var(--blue); } .ptr.ready svg { transform: rotate(90deg); }
.ptr.loading svg { animation: spin .7s linear infinite; }
@media (min-width: 821px) { .ptr { display: none; } }

/* ---------- Mosaic ảnh (1–5 ảnh) ---------- */
.media-grid.n5 { grid-template-columns: repeat(6, 1fr); }
.media-grid.n5 > :nth-child(-n+2) { grid-column: span 3; aspect-ratio: 4 / 3; }
.media-grid.n5 > :nth-child(n+3) { grid-column: span 2; aspect-ratio: 1; }
.media-grid.n4 { grid-template-columns: repeat(3, 1fr); }
.media-grid.n4 > :first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.media-grid.n4 > :nth-child(n+2) { aspect-ratio: 1; }

/* ---------- Trình xem ảnh: carousel ---------- */
.lightbox { touch-action: none; user-select: none; outline: none; }
.lb-stage { display: grid; place-items: center; width: 100%; height: 100%; }
.lightbox .lb-img { max-width: 100vw; max-height: 100dvh; object-fit: contain; transition: transform .12s ease-out; will-change: transform; touch-action: none; }
.lb-dots { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 7px; pointer-events: none; }
.lb-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); transition: background .2s, transform .2s; } .lb-dots i.on { background: #fff; transform: scale(1.3); }
.lb-count { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px; color: #fff; font-size: 13px; font-weight: 700; background: rgba(0,0,0,.45); border-radius: 999px; padding: 4px 10px; }
.lb-x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 44px; height: 44px; font-size: 30px; line-height: 1; color: #fff; border-radius: 50%; background: rgba(0,0,0,.35); }
.lb-heart { position: absolute; top: 50%; left: 50%; margin: -40px 0 0 -40px; font-size: 80px; line-height: 80px; opacity: 0; pointer-events: none; }
.lb-heart.show { animation: heart .8s ease-out; }

/* ---------- Bình luận dạng bottom sheet (điện thoại) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10,15,25,.5); z-index: 139; animation: fade .15s; }
body.sheet-open { overflow: hidden; }
.comments.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 140; max-height: 84dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 36px rgba(0,0,0,.28); padding: 0 14px calc(10px + env(safe-area-inset-bottom)); margin: 0; border-top: 0; animation: sheet-up .24s cubic-bezier(.2,.8,.2,1); }
.sheet-handle { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 10px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; margin: 0 -14px; }
.sheet-handle i { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-title { position: sticky; top: 23px; z-index: 2; background: var(--card); display: flex; align-items: center; justify-content: space-between; padding: 2px 0 8px; border-bottom: 1px solid var(--line); }
.sheet-title .icon-btn { width: 40px; height: 40px; }
.comments.sheet .cm-form { position: sticky; bottom: 0; background: var(--card); padding: 8px 0 4px; margin-top: 8px; }

/* ---------- Hồ sơ: tab Trả lời ---------- */
.reply-card { display: flex; flex-direction: column; gap: 8px; }
.reply-quote { display: block; border-left: 3px solid var(--line); padding: 4px 10px; color: var(--muted); font-size: 13px; word-break: break-word; max-height: 4.2em; overflow: hidden; text-decoration: none; }
.reply-body { word-break: break-word; white-space: pre-wrap; }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Vòng story quanh avatar (chưa xem = vàng, đã xem = xám) ---------- */
.av-wrap.story-unseen .av { box-shadow: 0 0 0 2px var(--card), 0 0 0 4.5px var(--yellow); }
.av-wrap.story-seen .av { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--line); }
.story-avatar .av-wrap .av, .moment-av .av-wrap .av, .sv-head .av-wrap .av, .mv-head .av-wrap .av, .story-create-art .av-wrap .av, .skel .av { box-shadow: none !important; }

/* Bộ sticker HVO tự host, dùng chung giữa bình luận và giao diện module. */
.sticker-pack-tabs { display: flex; gap: 6px; margin: 14px 0; overflow-x: auto; }
.sticker-pack-tabs button { min-height: 44px; flex: none; padding: 8px 14px; border-radius: 12px; font-weight: 600; font-size: 13px; background: var(--hover); }
.sticker-pack-tabs [aria-selected=true] { color: var(--blue); background: var(--blue-soft); }
.sticker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: 48dvh; overflow-y: auto; padding: 4px; margin-bottom: 12px; }
.sticker-grid button { position: relative; padding: 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); min-width: 0; }
.sticker-grid button:hover { border-color: var(--blue); background: var(--blue-soft); }
.sticker-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.sticker-grid span { display: block; font-size: 11px; padding: 4px 2px; line-height: 1.4; }
.sticker-grid small { position: absolute; top: 5px; right: 5px; border-radius: 5px; padding: 2px 5px; background: var(--blue); color: #fff; font-size: 9px; }
.sticker-media { width: 140px !important; height: 140px !important; max-width: 100% !important; object-fit: contain !important; border-radius: 16px; }
.cm-form { gap: 6px; }
.cm-form > .icon-btn { flex: none; }

/* Video dọc: một lượt hữu hạn, thao tác chuyển chủ động. */
.media-grid > div { position: relative; }
.video-open { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 12px; color: #fff; background: rgba(0,0,0,.72); font-size: 12px; font-weight: 600; }
.media-grid:not(.n1) .video-open { top: 6px; right: 6px; width: 44px; height: 44px; padding: 10px; font-size: 0; gap: 0; }
.vertical-player { position: fixed; inset: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 0; background: #0A0E16; color: #fff; overflow: hidden; }
.vertical-player::backdrop { background: #0A0E16; }
.vp-shell { height: 100%; display: flex; flex-direction: column; padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left)); }
.vp-header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; }
.vp-header b { display: block; font-size: 16px; }
.vp-header small { display: block; font-size: 11px; color: #B7C5D9; }
.vp-header .icon-btn { width: 44px; height: 44px; color: #fff; background: #202938; }
.vp-stage { position: relative; flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; touch-action: pan-x; }
.vp-stage video { display: block; width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain; }
.vp-error { position: absolute; top: 40%; left: 12px; right: 12px; padding: 14px; border-radius: 12px; background: #202938; text-align: center; font-size: 14px; }
.vp-footer { flex: none; width: min(100%, 600px); margin: 0 auto; padding: 10px 4px 12px; }
.vp-caption { font-size: 13px; max-height: 3em; overflow: auto; overflow-wrap: anywhere; }
.vp-status { color: #B7C5D9; font-size: 11px; margin: 6px 0 10px; }
.vp-nav { display: flex; justify-content: center; gap: 10px; }
.vp-nav button, .vp-break button { min-height: 44px; padding: 10px 16px; border-radius: 12px; color: #fff; background: #202938; font-size: 13px; font-weight: 600; }
.vp-nav button:disabled { opacity: .4; cursor: default; }
.vp-nav [data-vp-next], .vp-break button { background: var(--blue); }
.vp-break { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.vp-break > span { font-size: 54px; }
.vp-break h2 { font-size: 24px; }
.vp-break p { max-width: 360px; line-height: 1.7; font-size: 15px; color: #B7C5D9; }
@media (max-width: 820px) {
  .sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 42dvh; }
  .vp-header { padding: 6px 0; }
  .vp-nav { gap: 6px; }
  .vp-nav button { padding: 10px 12px; font-size: 12px; }
}

/* Trang chủ: ưu tiên bảng tin, chỉ một dải cập nhật tại mỗi thời điểm. */
#center.home-feed { gap: 10px !important; }
.home-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-heading h1 { font-size: 22px; white-space: nowrap; }
.home-heading nav { display: flex; gap: 4px; }
.home-heading a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: 10px; }
.home-heading a:hover { color: var(--blue); background: var(--blue-soft); }
.home-heading svg { width: 16px; height: 16px; }
.home-feed .composer:not(.is-expanded) { padding: 14px; }
.home-feed .composer:not(.is-expanded) textarea { height: 44px; min-height: 44px; padding: 11px 0; }
.home-feed .composer:not(.is-expanded) .tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; gap: 4px; }
.home-feed .composer:not(.is-expanded) .tool { min-height: 40px; justify-content: center; }
.home-feed .composer:not(.is-expanded) .tools > select, .home-feed .composer:not(.is-expanded) .tools > .btn, .home-feed .composer:not(.is-expanded) .tools > .grow { display: none; }
.home-updates { position: relative; padding: 0; overflow: hidden; }
.home-update-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 12px; }
.home-update-toolbar [role=tablist] { display: flex; min-width: 0; gap: 4px; }
.home-update-toolbar [role=tab] { min-height: 44px; padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.home-update-toolbar [aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }
.home-update-toggle { flex: none; min-height: 44px; padding: 0 8px; font-size: 11px; color: var(--muted); }
.home-update-toolbar button:hover { background: var(--hover); }
.home-updates [hidden] { display: none !important; }
.home-updates [role=tabpanel] > .card { border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 6px 14px 10px; }
.home-updates .stories-heading { min-height: 26px; margin-bottom: 4px; gap: 8px; }
.home-updates .stories-heading h2 { display: none; }
.home-updates .stories-section .stories-heading { position: absolute; top: 8px; right: 80px; min-height: 0; margin: 0; }
.home-updates .stories-section .stories-heading > div:first-child { display: none; }
.home-updates .story-scroll-controls .icon-btn { width: 28px; height: 28px; }
.home-updates .skel { padding: 10px 14px; gap: 8px; }
.home-updates .skel-block { height: 60px; }
.home-updates .stories-heading span { font-size: 10px; }
.home-updates .stories-section .story { width: 92px; flex-basis: 92px; height: 112px; border-radius: 12px; }
.home-updates .story-create-art { bottom: 34px; }
.home-updates .story-create-art .av { --s: 40px !important; }
.home-updates .story-create-plus { width: 28px; height: 28px; left: calc(50% - 14px); bottom: 23px; }
.home-updates .story-create-label { bottom: 7px; }
.home-updates .story-create-label > span, .home-updates .story-tile-label > span { display: none; }
.home-updates .story-avatar { top: 7px; left: 7px; }
.home-updates .story-text-preview { font-size: 12px; padding: 44px 7px 30px; }
.home-updates .story-tile-label { left: 7px; right: 7px; bottom: 7px; }
.home-updates .stories-empty { padding: 6px 8px; min-width: 130px; }
.home-updates .stories-empty-icon { display: none; }
.home-updates .stories-empty b { font-size: 13px; }
.home-updates .stories-empty p { font-size: 11px; margin-top: 4px; }
.home-updates .moments, .home-updates .notes { min-height: 137px; }
.home-updates .moments { align-items: center; }
.home-updates .notes { padding-top: 48px; }
.home-feed-filters .filters { margin-right: 0; padding: 0 0 3px; }
@media (max-width: 820px) {
  .home-heading { gap: 4px; }
  .home-heading h1 { font-size: 19px; }
  .home-heading nav { gap: 0; }
  .home-heading a { font-size: 11px; padding: 0 6px; }
  .home-heading svg { display: none; }
  .home-update-toolbar { padding: 0 6px; }
  .home-update-toolbar [role=tab] { font-size: 12px; padding: 0 8px; }
  .home-update-toggle { font-size: 10px; padding: 0 6px; }
  .home-updates .stories-section .stories-heading { display: none; }
  .home-updates [role=tabpanel] > .card { padding: 4px 10px 8px; }
  .home-updates .stories-heading { padding: 0; }
  .home-updates .stories-heading > div:first-child { min-width: 0; }
  .home-updates .stories-heading span { line-height: 1.4; }
}

/* Khung đăng bài mở rộng (khảo sát/câu hỏi) trên điện thoại: không tràn ngang, công cụ gọn một hàng */
.composer, .composer .grow, .poll-edit { min-width: 0; max-width: 100%; }
.poll-edit input[type=text] { box-sizing: border-box; min-width: 0; font-size: 16px; }
.poll-edit .row { flex-wrap: wrap; align-items: center; min-width: 0; }
.poll-edit .row select { min-width: 0; max-width: 100%; flex: 1 1 140px; }
@media (max-width: 820px) {
  .composer.is-expanded .tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .composer.is-expanded .tool { flex-direction: column; justify-content: center; font-size: 10px; gap: 5px; padding: 5px 0; min-height: 40px; }
  .composer.is-expanded .tools > .grow { display: none; }
  .composer.is-expanded .tools > select { grid-column: span 2; max-width: none; width: 100%; }
  .composer.is-expanded .tools > select:only-of-type { grid-column: 1 / -1; }
  .composer.is-expanded .tools > [data-k=send] { grid-column: 1 / -1; justify-self: end; margin-left: 0; }
}

/* Ghi chú: bong bóng nằm TRÊN avatar (chỉ chồng nhẹ), không che mặt và không bị cắt ở mép trái */
.notes, .home-updates .notes { padding: 52px 16px 6px; gap: 30px; align-items: flex-start; }
.note-bubble { bottom: calc(100% - 12px); -webkit-line-clamp: 3; }
