html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; background-color: #f7f2e9;
  background-image: radial-gradient(ellipse at 10% 0%, rgba(198,160,78,.10), transparent 45%), radial-gradient(ellipse at 90% 100%, rgba(107,74,43,.10), transparent 45%); }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- หัวเว็บ ---------- */
.hdr { background: linear-gradient(180deg, #0f0700 0%, #130a02 100%); box-shadow: 0 2px 14px rgba(0,0,0,.6); border-bottom: 1px solid rgba(198,160,78,.6); }
.logo-img { display: block; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%); }
.catbar { background: #0e0905; border-top: 1px solid rgba(198,160,78,.25); }
.logo-ring { display: inline-flex; padding: 3px; border-radius: 999px; background: linear-gradient(135deg, #eed9a6, #c6a04e 50%, #a4822f); box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.4); }
.search-box { background: #fffdf9; border-radius: .6rem; border: 1px solid #c6a04e; overflow: hidden; }

/* ---------- ปุ่ม ---------- */
.btn-gold { background: linear-gradient(180deg, #e3c47a 0%, #c6a04e 60%, #b08e3c 100%); color: #2b1b0e; border: 1px solid #a4822f; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 6px rgba(0,0,0,.25); transition: filter .15s, transform .15s; }
.btn-gold:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-outline { border: 1px solid #c6a04e; color: #eed9a6; background: rgba(0,0,0,.25); }
.btn-outline:hover { background: rgba(198,160,78,.15); }

/* ---------- แบนเนอร์หลัก ---------- */
.hero { background: radial-gradient(ellipse at 80% 50%, rgba(198,160,78,.35) 0%, transparent 50%), linear-gradient(110deg, #1f130a 0%, #3a2513 45%, #5a3d1f 100%); border: 1px solid rgba(198,160,78,.6); box-shadow: 0 10px 40px -12px rgba(43,27,14,.6); }
.hero-orn { position: absolute; right: -40px; top: -20px; height: 130%; opacity: .55; pointer-events: none; }
@media (max-width: 640px) { .hero-orn { right: -120px; opacity: .3; } }
.gold-text { background: linear-gradient(180deg, #f7e7bb 0%, #dcbc74 55%, #b8923f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 2px 12px rgba(0,0,0,.25); }

/* ---------- ลวดลาย/หัวข้อ ---------- */
.orn { width: 120px; height: 10px; background: linear-gradient(90deg, transparent, #c6a04e 30%, #c6a04e 70%, transparent); position: relative; }
.orn::after { content: '◆'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #eed9a6; font-size: 10px; background: #3a2513; padding: 0 6px; }
.orn-sm { display: inline-block; width: 22px; height: 22px; margin-right: 10px; vertical-align: -4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c6a04e' d='M12 1l2.6 6.3L21 9l-5 4.4 1.6 6.6L12 16.5 6.4 20l1.6-6.6L3 9l6.4-1.7z'/%3E%3Ccircle cx='12' cy='11' r='2.2' fill='%23fbf6ea'/%3E%3C/svg%3E") center/contain no-repeat; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: .8rem; padding-bottom: .4rem; border-bottom: 1px solid rgba(198,160,78,.45); }
.sec-head h2 { font-family: Prompt, Sarabun, sans-serif; font-weight: 700; font-size: 1.3rem; color: #2b1b0e; }
.sec-head a { font-size: .85rem; color: #a4822f; }
.sec-head a:hover { text-decoration: underline; }
.vip-badge { display: inline-block; background: linear-gradient(180deg, #eed9a6, #c6a04e); color: #2b1b0e; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 4px; letter-spacing: .05em; vertical-align: middle; }

/* ---------- การ์ด ---------- */
.lux-frame { border: 1px solid #dcc9a2; box-shadow: 0 1px 2px rgba(60,40,10,.06), inset 0 0 0 1px rgba(255,255,255,.6); }
.card:hover { box-shadow: 0 12px 28px -10px rgba(90,60,20,.4); border-color: #c6a04e; }
.gold-img { box-shadow: inset 0 0 0 2px #c6a04e, inset 0 0 0 4px #2b1b0e; }
.cat-card { display: flex; align-items: center; gap: .6rem; background: #fffdf9; border: 1px solid #dcc9a2; border-radius: .75rem; padding: .6rem .75rem; transition: all .15s; }
.cat-card:hover { border-color: #c6a04e; box-shadow: 0 6px 16px -8px rgba(90,60,20,.4); transform: translateY(-1px); }

/* ---------- บทความ ---------- */
.prose-body { font-size: 1.05rem; line-height: 1.85; }
.prose-body h2 { font-family: Prompt, Sarabun, sans-serif; font-size: 1.4rem; font-weight: 700; margin: 1.6em 0 .6em; }
.prose-body h3 { font-family: Prompt, Sarabun, sans-serif; font-size: 1.15rem; font-weight: 600; margin: 1.4em 0 .5em; }
.prose-body p { margin: 0 0 1em; }
.prose-body ul, .prose-body ol { margin: 0 0 1em 1.5em; }
.prose-body ul { list-style: disc; } .prose-body ol { list-style: decimal; }
.prose-body img { max-width: 100%; height: auto; border-radius: .75rem; margin: 1em auto; display: block; }
.prose-body figure { margin: 1.2em 0; } .prose-body figcaption { text-align: center; font-size: .85rem; color: #78716c; }
.prose-body blockquote { border-left: 4px solid #c6a04e; padding-left: 1rem; color: #57534e; margin: 1em 0; }
.prose-body table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose-body td, .prose-body th { border: 1px solid #e9dfcd; padding: .4rem .6rem; }
.prose-body a { color: #6b4a2b; text-decoration: underline; }

/* ---------- ฟอร์ม ---------- */
.bg-white { background-color: #fffdf9; }
input[type=file] { font-size: .85rem; }
select, input, textarea { background: #fff; }
input, select, textarea { border-color: #d9cdb6 !important; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c6a04e55; border-color: #c6a04e !important; }
::-webkit-scrollbar { height: 6px; width: 8px; } ::-webkit-scrollbar-thumb { background: #d9cdb6; border-radius: 4px; }
.hero-pic { -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 35%); mask-image: linear-gradient(90deg, transparent 0%, #000 35%); }
@media (max-width: 640px) { .hero-pic { opacity: .45; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%); mask-image: linear-gradient(90deg, transparent 0%, #000 60%); } }
.logo-pill { display: inline-flex; align-items: center; background: linear-gradient(180deg, #d8c08f, #bda26b); border: 1px solid rgba(198,160,78,.7); border-radius: 999px; padding: 3px 10px 3px 4px; box-shadow: 0 1px 4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35); }

/* ---------- เมนูหมวดด้านซ้าย ---------- */
.side-cats { background: #1a1208; border: 1px solid rgba(198,160,78,.45); border-radius: .9rem; overflow: hidden; color: #f5ebd1; }
.side-head { display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; font-family: Prompt, Sarabun, sans-serif; font-weight: 700; font-size: 1.05rem; background: #120c06; border-bottom: 1px solid rgba(198,160,78,.4); }
.side-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; border: 2px solid #c6a04e; color: #e3c47a; font-size: 15px; }
.side-cats ul { list-style: none; margin: 0; padding: 0; }
.side-cats li + li { border-top: 1px solid rgba(255,255,255,.07); }
.side-cats a { display: flex; justify-content: space-between; align-items: center; padding: .62rem .95rem; font-size: .95rem; color: #f5ebd1; transition: background .12s; }
.side-cats a span { font-size: .72rem; color: rgba(245,235,209,.45); }
.side-cats a:hover { background: rgba(198,160,78,.14); color: #eed9a6; }
.side-cats a.active { background: rgba(198,160,78,.22); color: #eed9a6; border-left: 3px solid #c6a04e; }
@media (max-width: 1023px) { .side-cats ul { display: grid; grid-template-columns: 1fr 1fr; } .side-cats li + li { border-top: 0; } .side-cats a { border-bottom: 1px solid rgba(255,255,255,.07); } }
.side-main a span { color: #c6a04e; font-size: .9rem; }
.side-main a.gold { color: #e3c47a; font-weight: 600; }
.user-menu summary::-webkit-details-marker { display: none; }
.ps-opt { display: flex; flex-direction: column; gap: 2px; border: 1px solid #d9cdb6; border-radius: .6rem; padding: .55rem .7rem; cursor: pointer; background: #fffdf9; }
.ps-opt input { position: absolute; opacity: 0; }
.ps-opt span { font-weight: 600; }
.ps-opt small { color: #78716c; font-size: .72rem; }
.ps-opt:has(input:checked) { border-color: #c6a04e; background: #fbf6ea; box-shadow: 0 0 0 2px rgba(198,160,78,.35); }
/* ---------- กล่องราคา/สถานะบนการ์ด ---------- */
.price-pill { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: .5rem; font-family: Prompt, Sarabun, sans-serif; font-weight: 700; font-size: .95rem; line-height: 1.35; white-space: nowrap; }
.price-pill.ps-price { background: linear-gradient(180deg, #f1dfae, #d6b45c); color: #3a2513; border: 1px solid #b08e3c; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.price-pill.ps-call { background: #fffdf9; color: #6b4a2b; border: 1px dashed #c6a04e; font-weight: 600; font-size: .85rem; }
.price-pill.ps-show { background: linear-gradient(180deg, #4a3119, #2b1b0e); color: #eed9a6; border: 1px solid #c6a04e; font-size: .85rem; }
.price-pill.ps-reserved { background: #b45309; color: #fff; border: 1px solid #92400e; font-size: .85rem; }
.price-pill.ps-sold { background: #44403c; color: #e7e5e4; border: 1px solid #292524; font-size: .85rem; }
/* ---------- ปุ่มเลือกไฟล์ ---------- */
input[type=file] { width: 100%; border: 1px dashed #c6a04e !important; border-radius: .6rem; padding: .35rem; background: #fbf6ea; color: #57534e; font-size: .85rem; cursor: pointer; }
input[type=file]:hover { background: #f5ebd1; }
input[type=file]::file-selector-button { background: linear-gradient(180deg, #e3c47a 0%, #c6a04e 60%, #b08e3c 100%); color: #2b1b0e; border: 1px solid #a4822f; border-radius: .45rem; padding: .4rem .9rem; margin-right: .7rem; font-family: Sarabun, sans-serif; font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
input[type=file]::file-selector-button:hover { filter: brightness(1.07); }
.file-prev { margin-top: .5rem; max-height: 8rem; border-radius: .5rem; border: 1px solid #dcc9a2; }
/* ---------- ครอปรูป ---------- */
.crop-modal { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.75); align-items: center; justify-content: center; padding: 12px; }
.crop-box { background: #fffdf9; border: 1px solid #c6a04e; border-radius: 1rem; width: min(720px, 100%); max-height: 95dvh; display: flex; flex-direction: column; overflow: hidden; }
.crop-head { padding: .7rem 1rem; font-weight: 600; background: #2b1b0e; color: #eed9a6; }
.crop-area { background: #1a1208; max-height: 65dvh; }
.crop-area img { display: block; max-width: 100%; }
.crop-tools { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem; border-top: 1px solid #e9dfcd; }
.crop-tools button { border: 1px solid #d9cdb6; background: #fff; border-radius: .5rem; padding: .4rem .8rem; font-size: .85rem; cursor: pointer; }
.crop-tools .crop-ok { background: linear-gradient(180deg, #e3c47a, #c6a04e); border-color: #a4822f; font-weight: 700; color: #2b1b0e; }
.crop-tools .crop-cancel { color: #78716c; }
.crop-circle .cropper-view-box, .crop-circle .cropper-face { border-radius: 50%; }
.crop-circle .cropper-view-box { outline: 2px solid #e3c47a; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.crop-circle .cropper-dashed, .crop-circle .cropper-center { display: none; }

/* ---------- หัวหน้าร้าน ---------- */
.shop-hero { box-shadow: 0 10px 30px -14px rgba(43,27,14,.5); }
.shop-cover { background: radial-gradient(ellipse at 70% 40%, rgba(198,160,78,.35), transparent 55%), linear-gradient(110deg, #1f130a, #3a2513 50%, #5a3d1f); }
.trust-ico { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 999px; background: rgba(198,160,78,.2); border: 1px solid rgba(198,160,78,.6); font-size: 13px; }
.trust-box { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: .75rem; background: linear-gradient(180deg, #f5ebd1, #e3c47a); border: 1px solid #c6a04e; font-size: 20px; flex-shrink: 0; }
.verified-badge { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 999px; background: linear-gradient(180deg, #e3c47a, #b08e3c); color: #2b1b0e; font-size: 13px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.stat-card { display: flex; align-items: center; gap: .9rem; background: #fffdf9; border: 1px solid #e9dfcd; border-radius: 1rem; padding: .9rem 1.1rem; }
a.stat-card:hover { border-color: #c6a04e; }
.stat-ico { display: inline-flex; width: 46px; height: 46px; align-items: center; justify-content: center; border-radius: .8rem; background: #fbf6ea; border: 1px solid #e9dfcd; font-size: 22px; }

/* ---------- ปุ่มไลค์บนการ์ด ---------- */
.like-btn { width: 32px; height: 32px; border-radius: 999px; background: rgba(255,253,249,.92); border: 1px solid #e9dfcd; color: #c2410c; font-size: 16px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .12s, background .12s; }
.like-btn:hover { background: #fff1f2; transform: scale(1.1); border-color: #fda4af; }
/* ---------- แชท ---------- */
.bubble { border-radius: 1.1rem; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble-me { background: linear-gradient(180deg, #5a3d1f, #3a2513); color: #f5ebd1; border-bottom-right-radius: .3rem; }
.bubble-them { background: #fff; border: 1px solid #e9dfcd; color: #241a11; border-bottom-left-radius: .3rem; }
.bubble a { color: inherit; }
/* ---------- แท็บเมนูหลังร้าน ---------- */
.shop-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #f3ebdb; border: 1px solid #dcc9a2; border-radius: .8rem; font-size: .9rem; }
.shop-tabs a { display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .85rem; border-radius: .55rem; color: #4a3119; border: 1px solid transparent; transition: all .12s; }
.shop-tabs a:hover { background: #fffdf9; border-color: #dcc9a2; }
.shop-tabs a.on { background: #fffdf9; border-color: #c6a04e; color: #2b1b0e; font-weight: 600; box-shadow: 0 1px 3px rgba(60,40,10,.15); }
.shop-tabs a.gold { background: linear-gradient(180deg, #e3c47a, #c6a04e); color: #2b1b0e; font-weight: 600; border-color: #a4822f; }
.shop-tabs a.preview { margin-left: auto; border-color: #c6a04e; background: #fffdf9; }
.shop-tabs a.gold { margin-left: 4px; }
@media (max-width: 640px) { .shop-tabs a.preview { margin-left: 0; } }

.bubble-deleted { background: transparent; border: 1px dashed #d6c7a8; color: #a8a29e; }
.unsend-btn { align-self: center; margin-right: .4rem; width: 24px; height: 24px; border-radius: 999px; color: #a8a29e; font-size: 16px; line-height: 1; opacity: 0; transition: opacity .15s; }
.flex:hover > .unsend-btn, .unsend-btn:focus { opacity: 1; }
@media (hover: none) { .unsend-btn { opacity: .6; } }
.msg-meta { align-self: flex-end; font-size: 10px; color: #a8a29e; line-height: 1.2; margin: 0 .4rem 2px; white-space: nowrap; }
.msg-meta.mine { text-align: right; display: inline-flex; flex-direction: column; align-items: flex-end; }
.msg-meta .meta-read { color: #8f6d22; font-weight: 600; }

.like-btn.watch { color: #8f6d22; font-size: 14px; }
.like-btn.watch:hover { background: #fbf6ea; border-color: #c6a04e; }

.trust-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; background: #fbf6ea; border: 1px solid #e3c47a; color: #4a3119; white-space: nowrap; }
/* ---------- ปุ่มใต้การ์ด ---------- */
.card-actions { display: flex; gap: 4px; padding: 6px 8px 8px; margin-top: auto; }
.act-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; padding: .3rem .4rem; border-radius: .5rem; border: 1px solid #e9dfcd; background: #fffdf9; font-size: .75rem; color: #57534e; cursor: pointer; transition: all .12s; white-space: nowrap; }
.act-btn.like { color: #c2410c; }
.act-btn.like:hover { background: #fff1f2; border-color: #fda4af; }
.act-btn.watch { color: #8f6d22; }
.act-btn.watch:hover { background: #fbf6ea; border-color: #c6a04e; }

.act-btn.cmt { color: #1d4ed8; }
.act-btn.cmt:hover { background: #eff6ff; border-color: #93c5fd; }

.act-btn.like { color: #1d4ed8; }
.act-btn.like:hover { background: #eff6ff; border-color: #93c5fd; }
.act-btn.on, .act-btn.on:hover { background: #e7e5e4; border-color: #d6d3d1; color: #44403c; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.act-btn.like.on { color: #1d4ed8; }
.act-btn.watch.on { color: #8f6d22; }

/* ---------- สติกเกอร์ ---------- */
.stk-pop { position: absolute; z-index: 130; background: #fffdf9; border: 1px solid #c6a04e; border-radius: 1rem; box-shadow: 0 12px 30px -8px rgba(43,27,14,.45); padding: .5rem; width: 290px; }
.stk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.stk { font-size: 26px; line-height: 1; padding: 6px 0; border-radius: .5rem; transition: transform .1s, background .1s; }
.stk:hover { background: #fbf6ea; transform: scale(1.25); }
.stk-stage { margin-top: .4rem; }
.stk-stage.hidden { display: none; }

/* ---------- คอมเมนต์ (สไตล์เฟซบุ๊ก) ---------- */
.cm-item { display: flex; gap: .5rem; padding: .3rem 0; }
.cm-ava { width: 32px; height: 32px; border-radius: 999px; overflow: hidden; background: #e9dfcd; flex-shrink: 0; }
.cm-ava-sm { width: 24px; height: 24px; }
.cm-main { min-width: 0; flex: 1; }
.cm-head { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; line-height: 1.3; }
.cm-name { font-size: .84rem; font-weight: 700; color: #241a11; }
.cm-owner { font-size: 10px; font-weight: 600; background: linear-gradient(180deg, #e3c47a, #c6a04e); color: #2b1b0e; padding: 1px 7px; border-radius: 999px; }
.cm-time { font-size: .72rem; color: #78716c; }
.cm-body { font-size: .86rem; line-height: 1.45; white-space: pre-line; word-break: break-word; color: #241a11; margin-top: 2px; }
.cm-sticker { font-size: 2.6rem; line-height: 1; margin: .35rem 0 .1rem; user-select: none; }
.cm-img { margin-top: .3rem; border-radius: .75rem; max-height: 14rem; }
.cm-actions { display: flex; align-items: center; gap: .15rem; margin-top: .1rem; font-size: 12px; color: #57534e; }
.cm-actions button { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: #57534e; border-radius: .4rem; padding: .15rem .4rem; }
.cm-actions svg { width: 15px; height: 15px; }
.cm-actions button:hover { background: #f1ebdf; }
.cm-actions .cm-like.on { color: #1b74e4; }
.cm-actions .cm-del:hover { color: #dc2626; }
.cm-likepill { display: inline-flex; align-items: center; gap: 3px; margin-left: .25rem; font-size: 12px; color: #57534e; }
.cm-likepill-ico { display: inline-flex; width: 18px; height: 18px; border-radius: 999px; background: #1b74e4; color: #fff; align-items: center; justify-content: center; }
.cm-likepill-ico svg { width: 11px; height: 11px; }
.cm-replies { margin-top: .15rem; }
.cm-replies .cm-item { padding: .2rem 0; }
.cm-replybox { }

/* ---------- เมนูสมาชิก ---------- */
.um-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgba(238,217,166,.45); padding: .25rem .6rem .15rem; }
.um-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: .6rem; color: #f5ebd1; transition: background .12s; }
.um-item:hover { background: rgba(198,160,78,.16); }
.um-ico { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: .5rem; background: rgba(198,160,78,.12); font-size: 14px; flex-shrink: 0; }
.um-gold { color: #eed9a6; font-weight: 600; }
.um-gold .um-ico { background: linear-gradient(180deg, #e3c47a, #c6a04e); color: #2b1b0e; }

/* ---------- แท็บหน้าแรก (สไตล์เฟซบุ๊ก) ---------- */
.home-tabs { position: sticky; top: 66px; z-index: 30; display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 0 -2px; background: rgba(247,242,233,.92); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(198,160,78,.35); scrollbar-width: none; }
@media (min-width: 640px) { .home-tabs { top: 82px; } }
.home-tabs::-webkit-scrollbar { display: none; }
.home-tabs button { flex-shrink: 0; padding: .45rem .95rem; border-radius: 999px; font-size: .9rem; font-weight: 600; color: #4a3119; background: #fffdf9; border: 1px solid #e9dfcd; transition: all .12s; white-space: nowrap; }
.home-tabs button:hover { background: #fbf6ea; border-color: #c6a04e; }
.home-tabs button.on { background: linear-gradient(180deg, #4a3119, #2b1b0e); color: #eed9a6; border-color: #2b1b0e; box-shadow: 0 2px 6px rgba(43,27,14,.3); }

/* ---------- ฟีดแบบเฟซบุ๊ก ---------- */
.feed-wrap { max-width: 680px; margin: 0 auto; }
.feed-post { background: #fffdf9; border: 1px solid #e9dfcd; border-radius: 1rem; box-shadow: 0 1px 2px rgba(60,40,10,.06); margin-bottom: 14px; overflow: hidden; }
.feed-media { display: grid; gap: 3px; background: #2b1b0e; position: relative; }
.feed-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-media-1 { grid-template-columns: 1fr; }
.feed-media-1 img { max-height: 560px; object-fit: contain; background: #1a1208; }
.feed-media-2 { grid-template-columns: 1fr 1fr; }
.feed-media-2 img { aspect-ratio: 1 / 1; }
.feed-media-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-media-3 .feed-main { grid-row: 1 / span 2; aspect-ratio: 1 / 1.1; }
.feed-media-3 .feed-side { aspect-ratio: 1 / 1.1; }
.feed-more { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; padding: .2rem .6rem; border-radius: .5rem; font-size: .9rem; }
.fp-btn { padding: .6rem .25rem; color: #57534e; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; white-space: nowrap; font-size: .85rem; }
.fp-btn:hover { background: #fbf6ea; }
.fp-btn.on { color: #1b74e4; font-weight: 700; }
.feed-watch.on { color: #8f6d22; }

.feed-tag { display: inline-flex; align-items: center; gap: .2rem; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #fbf6ea; border: 1px solid #e3c47a; color: #8f6d22; white-space: nowrap; }
.feed-mini .feed-tag { font-size: 11px; }
.feed-media-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-media-4 img { aspect-ratio: 1 / 1; }
.feed-media-4 .feed-main { grid-column: 1 / span 2; aspect-ratio: 2 / 1; }

/* ---------- ตารางรูปแบบเฟซบุ๊ก ---------- */
.fm { display: grid; gap: 2px; background: #fff; position: relative; overflow: hidden; cursor: zoom-in; }
.fm img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.fm-1 { grid-template-columns: 1fr; }
.fm-1 img { max-height: 600px; object-fit: contain; background: #1a1208; }
.fm-2 { grid-template-columns: 1fr 1fr; height: min(380px, 62vw); }
.fm-3 { grid-template-columns: 3fr 2fr; grid-template-rows: 1fr 1fr; height: min(440px, 78vw); }
.fm-3 .fm-tall { grid-row: 1 / span 2; }
.fm-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: min(500px, 92vw); }
.fm-5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 3fr 2fr; height: min(520px, 95vw); }
.fm-5 .fm-top { grid-column: span 3; }
.fm-5 img:not(.fm-top), .fm-5 .fm-last { grid-column: span 2; }
.fm-last { position: relative; display: block; min-height: 0; }
.fm-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; font-size: 2rem; font-weight: 700; }
/* ---------- ตัวดูรูป ---------- */
.pv { position: fixed; inset: 0; z-index: 140; background: rgba(20,12,4,.72); backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; }
.pv.hidden { display: none; }
.pv-stage { position: relative; display: flex; align-items: center; justify-content: center; width: min(94vw, 1000px); height: min(82vh, 760px); background: #0f0a05; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); overflow: visible; }
.pv-img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
@media (max-width: 640px) { .pv-stage { width: 96vw; height: 70vh; } }
.pv-close { position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 999px; background: #fff; color: #111; font-size: 15px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.5); z-index: 2; }
.pv-count { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.pv-prev, .pv-next { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 999px; background: rgba(255,255,255,.9); color: #111; font-size: 22px; line-height: 1; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.5); }
.pv-prev { left: -12px; } .pv-next { right: -12px; }
@media (max-width: 640px) { .pv-close { top: 6px; right: 6px; } .pv-prev { left: 6px; } .pv-next { right: 6px; } }
.pv-thumbs { display: flex; gap: 6px; margin-top: 12px; max-width: 94vw; overflow-x: auto; padding: 4px; }
.pv-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; opacity: .55; cursor: pointer; border: 2px solid transparent; }
.pv-thumbs img.on { opacity: 1; border-color: #e3c47a; }
.pv-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: 12px; background: rgba(0,0,0,.35); padding: 3px 12px; border-radius: 999px; pointer-events: none; }

/* ---------- justified layout ---------- */
.fm.fm-j { display: block; position: relative; height: 0; background: #fff; }
.fm.fm-j img { position: absolute; object-fit: cover; }
.fm.fm-j .fm-more { position: absolute; inset: auto; }

/* ---------- ผังรูปแบบเฟซบุ๊ก (JS กำหนด grid) ---------- */
.fm.fm-fb { display: grid; gap: 2px; background: #fff; position: relative; }
.fm.fm-fb img { width: 100%; height: 100%; object-fit: cover; min-height: 0; min-width: 0; }
.fm.fm-fb .fm-more { position: static; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #fff; font-size: 2rem; font-weight: 700; grid-area: auto; }
.fm.fm-fb .fm-more { position: relative; z-index: 1; margin: 0; }

/* ---------- ฟีด + แผงเพื่อนซ้าย ---------- */
.feed-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1024px) { .feed-layout { grid-template-columns: 290px minmax(0, 680px); justify-content: center; } .feed-left { position: sticky; top: 140px; } }
.feed-layout .feed-wrap { max-width: 680px; width: 100%; margin: 0; }
@media (max-width: 1023px) { .feed-left { order: 2; } .feed-layout .feed-wrap { margin: 0 auto; } }

.friends-tab .friends-side { display: grid; gap: 12px; }
@media (min-width: 768px) { .friends-tab .friends-side { grid-template-columns: 1fr 1fr; align-items: start; } .friends-tab .friends-side > div:first-child:nth-last-child(3) { grid-column: 1 / -1; } }

/* ---------- แผงซ้ายแบบเฟซบุ๊ก ---------- */
@media (min-width: 1024px) { .feed-layout { grid-template-columns: 300px minmax(0, 680px); justify-content: start; gap: 20px; } }
.fs-card { background: #fffdf9; border: 1px solid #e9dfcd; border-radius: 1rem; padding: .85rem .95rem; font-size: .9rem; }
.fs-title { font-family: Prompt, Sarabun, sans-serif; font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.fs-link { margin-left: auto; font-size: 11px; font-weight: 400; color: #a4822f; }
.fs-link:hover { text-decoration: underline; }
.fs-badge { background: #e11d48; color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; }
.fs-nav { display: grid; gap: 2px; }
.fs-nav a { display: flex; align-items: center; gap: .55rem; padding: .4rem .5rem; border-radius: .6rem; font-size: .88rem; color: #4a3119; }
.fs-nav a:hover { background: #fbf6ea; }
.fs-nav a span { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: .5rem; background: #f5ebd1; font-size: 14px; }
.fs-nav a b { margin-left: auto; font-size: 11px; font-weight: 600; color: #78716c; background: #f1ebdf; border-radius: 999px; padding: 1px 7px; }
.fs-nav a b.red { background: #e11d48; color: #fff; }
.fs-row { display: flex; align-items: center; gap: .55rem; padding: .35rem 0; border-top: 1px solid #f1ebdf; }
.fs-row:first-of-type { border-top: 0; }
.fs-ava { width: 38px; height: 38px; border-radius: 999px; overflow: hidden; background: #e9dfcd; flex-shrink: 0; }
.fs-ava.sm { width: 30px; height: 30px; }
.fs-ava img { width: 100%; height: 100%; object-fit: cover; }
.fs-name { display: block; font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-name:hover { text-decoration: underline; }

#rightPane .pane-full { max-width: none !important; padding-left: 0 !important; padding-right: 0 !important; padding-top: 0 !important; }
#rightPane .grid.lg\:grid-cols-\[300px_1fr\] { grid-template-columns: 1fr !important; }
#rightPane .friends-side { display: none; }

.feed-layout > .min-w-0 > [data-tab] { max-width: 100%; }
@media (min-width: 1024px) { .feed-layout { grid-template-columns: 300px minmax(0, 1fr); } .feed-layout .feed-wrap { max-width: 680px; } }
.feed-layout.no-left { grid-template-columns: 1fr !important; }
.feed-layout.no-left .feed-left { display: none; }

.pane-frame { width: 100%; border: 1px solid #e9dfcd; border-radius: 1rem; background: #fff; display: block; }
.pv-go { position: absolute; left: 10px; bottom: 10px; background: linear-gradient(180deg, #e3c47a, #c6a04e); color: #2b1b0e; font-weight: 700; font-size: 13px; padding: .35rem .8rem; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
