/* ============================================================
   Social — post feed manager (routes: #/social, #/social-picker,
   #/social-compose, #/social-preview, #/social-post)

   A post created here lands in the GCI Reward client app's Home
   feed, so the review screen mocks that app's full-bleed feed
   card rather than a generic social network.

   Prefix: so-
   ============================================================ */

#s-social { background: var(--surface-grey); overflow: hidden }

/* The Social header is shorter than Home's — no income card to sit under. */
.so-hdr-bg { height: 146px }

.so-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Clears the bottom nav; the create FAB floats over the last row. */
    padding: 0 16px 128px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch
}
.so-scroll::-webkit-scrollbar { display: none }

/* ── PUBLISHED BANNER ─────────────────────────────────────── */
/* Slides in on the hub after a post goes live, then fades itself out. */
.so-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-m);
    background: #E8F7EF;
    border: 1px solid #BBE7CE;
    animation: so-banner-in .28s ease
}
.so-banner.show { display: flex }
@keyframes so-banner-in {
    from { opacity: 0; transform: translateY(-6px) }
    to   { opacity: 1; transform: none }
}
.so-banner-ico {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center
}
.so-banner-txt {
    flex: 1;
    min-width: 0;
    font-size: var(--text-s);
    font-weight: var(--weight-semibold);
    color: var(--color-success-dark)
}
/* ── STATUS TABS ──────────────────────────────────────────── */
.so-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--surface-white);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card)
}
.so-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    border: 0;
    border-radius: var(--radius-s);
    background: none;
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--ink-400);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .18s, color .18s
}
.so-tab.active { background: var(--purple-75); color: var(--color-primary) }
.so-tab-count {
    min-width: 18px;
    padding: 0 5px;
    height: 16px;
    border-radius: var(--radius-pill);
    background: var(--surface-grey);
    color: var(--ink-400);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    display: flex;
    align-items: center;
    justify-content: center
}
.so-tab.active .so-tab-count { background: var(--color-primary); color: var(--surface-white) }

/* ── POST GRID ────────────────────────────────────────────── */
/* Two columns, thumbnail-led — the salon scans by picture, not by text. */
.so-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}
.so-card {
    background: var(--surface-white);
    border-radius: var(--radius-m);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(26,26,46,.06);
    transition: transform .12s
}
.so-card:active { transform: scale(.98) }
.so-card.pinned { outline: 1.5px solid var(--color-primary); outline-offset: -1.5px }

.so-card-thumb {
    position: relative;
    aspect-ratio: 3 / 4
}
/* Bottom scrim so the views pill stays readable on a pale photo. */
.so-card-thumb::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 46%;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
    pointer-events: none
}
/* Nhãn loại bài nằm góc trái, số lượng ảnh góc phải. Chữ mảnh chứ không
   đậm — nó là chú thích cho tấm ảnh, không phải tiêu đề của thẻ. */
.so-card-tags {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    display: flex;
    gap: 3px
}
/* Hai nhãn cộng bộ đếm phải lọt trong thẻ rộng ~155px của lưới hai cột,
   nên đệm bó sát và không giãn chữ. */
.so-card-kind,
.so-card-pin,
.so-card-count {
    padding: 2px 5px;
    border-radius: 100px;
    background: rgba(26,26,46,.6);
    backdrop-filter: blur(6px);
    color: var(--surface-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0
}
.so-card-kind {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap
}
.so-card-pin {
    position: absolute;
    left: 8px;
    bottom: 34px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--color-primary);
    font-weight: var(--weight-semibold)
}
.so-card-count {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    letter-spacing: 0
}
.so-card-views {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--surface-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    text-shadow: 0 1px 2px rgba(0,0,0,.3)
}
.so-card-views.draft {
    background: rgba(255,255,255,.9);
    color: var(--ink-500);
    padding: 2px 8px;
    border-radius: 100px;
    text-shadow: none
}

.so-card-body { padding: 10px 12px 12px }
.so-card-cap {
    font-size: var(--text-s);
    font-weight: var(--weight-semibold);
    line-height: 1.35;
    color: var(--ink-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}
.so-card-cap.empty { color: var(--ink-300); font-style: italic; font-weight: var(--weight-regular) }
.so-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px
}
.so-card-time { font-size: var(--text-xs); color: var(--ink-300) }
.so-card-more {
    border: 0;
    background: none;
    padding: 2px;
    margin: -2px -3px -2px 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center
}
.so-card-more:active { background: var(--surface-grey) }

/* Status pill — only the detail screen still shows one. */
.so-card-pill {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: .04em
}
.so-card-pill.published { background: #E8F7EF; color: var(--color-success-dark) }
.so-card-pill.draft { background: var(--surface-grey); color: var(--ink-400) }

/* ── CREATE POST FAB ──────────────────────────────────────── */
/* Bottom right, clear of the Quick Sale FAB that sits centred in the nav. */
.so-create {
    position: absolute;
    right: 16px;
    bottom: 122px;
    z-index: 60;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(95,46,234,.38);
    transition: transform .12s
}
.so-create:active { transform: scale(.92) }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.so-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px 20px;
    gap: 6px
}
.so-empty.show { display: flex }
.so-empty-ico {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--surface-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px
}
.so-empty-h1 {
    font-size: var(--text-m);
    font-weight: var(--weight-bold);
    color: var(--ink-700)
}
.so-empty-h2 {
    font-size: var(--text-s);
    line-height: 1.45;
    color: var(--ink-300);
    max-width: 230px
}
.so-empty-btn {
    margin-top: 10px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--surface-white);
    font-family: inherit;
    font-size: var(--text-s);
    font-weight: var(--weight-semibold);
    padding: 11px 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent
}
.so-empty-btn:active { opacity: .85 }

/* ============================================================
   MEDIA PICKER  ·  #/social-picker

   Dressed as the phone's own Photos sheet: album bar, dense 3-up
   grid, numbered selection order, clip durations. The salon should
   recognise it before reading a single label.
   ============================================================ */

#s-social-picker { background: var(--surface-white) }

.so-pk-hdr {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 16px 12px;
    border-bottom: 1px solid var(--border-weak)
}
.so-pk-cancel,
.so-pk-next {
    border: 0;
    font-family: inherit;
    background: none;
    padding: 6px 4px;
    font-size: var(--text-s);
    color: var(--ink-500);
    cursor: pointer
}
.so-pk-next { color: var(--color-primary); font-weight: var(--weight-semibold) }
.so-pk-next:disabled { color: var(--ink-200); cursor: default }
.so-pk-cancel:active, .so-pk-next:active:not(:disabled) { opacity: .6 }

/* Hero — the shot at full width before you commit to it, like Instagram. */
.so-pk-stage {
    position: relative;
    flex-shrink: 0;
    height: 300px;
    background: var(--ink-900);
    overflow: hidden
}
.so-pk-hero {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .18s
}
.so-pk-hero.show { opacity: 1 }
.so-pk-hero-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    color: rgba(255,255,255,.5)
}
.so-pk-hero-empty.hidden { display: none }
.so-pk-hero-tag {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: none;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--surface-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: .04em
}
.so-pk-hero-tag.show { display: block }

.so-pk-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px
}
/* Instagram viết tên album chữ thường, đậm, cỡ body — không phải nhãn
   in hoa giãn chữ. Số đã chọn nằm bên phải, màu chữ phụ. */
.so-pk-album {
    border: 0;
    font-family: inherit;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--text-m);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
    cursor: pointer
}
.so-pk-album:active { opacity: .6 }
.so-pk-meta {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-300)
}

.so-pk-grid {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;                 /* rãnh mảnh, ảnh gần như liền nhau như Instagram */
    /* `flex: 1` làm chiều cao lưới thành xác định, nên hàng `auto` bị chia đều
       theo chiều cao đó (113px) trong khi ô vẫn cao 158px theo aspect-ratio —
       các hàng chồng lên nhau 45px, cắt cụt ô Camera và viền ô đang chọn.
       `min-content` buộc hàng bám đúng chiều cao ô. */
    grid-auto-rows: min-content;
    align-content: start;
    -webkit-overflow-scrolling: touch
}
.so-pk-grid::-webkit-scrollbar { display: none }

.so-pk-cam,
.so-pk-tile {
    position: relative;
    aspect-ratio: 3 / 4;
    border: 0;
    padding: 0;
    cursor: pointer;
    overflow: hidden
}
/* Ô tối, chỉ một icon máy ảnh đặt giữa — cùng nhịp với các ô ảnh. */
.so-pk-cam {
    background: var(--ink-700);
    display: flex;
    align-items: center;
    justify-content: center
}
.so-pk-cam:active { background: var(--ink-900) }

.so-pk-tile:active { opacity: .85 }
/* Instagram không viền ô đã chọn — hai ô chọn cạnh nhau sẽ thành một vệt
   viền-rãnh-viền trông như lỗi render. Thay bằng lớp phủ trắng mờ, ranh
   giới giữa các ô vẫn là rãnh 2px sạch sẽ. */
.so-pk-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background .12s;
    pointer-events: none
}
.so-pk-tile.sel::after { background: rgba(255,255,255,.4) }

.so-pk-tick {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 1.6px solid rgba(255,255,255,.9);
    background: rgba(26,26,46,.22);
    color: var(--surface-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s
}
.so-pk-tile.sel .so-pk-tick {
    background: var(--color-primary);
    border-color: var(--color-primary)
}
.so-pk-dur {
    position: absolute;
    left: 7px;
    bottom: 6px;
    color: var(--surface-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    text-shadow: 0 1px 2px rgba(0,0,0,.45)
}

/* ============================================================
   COMPOSE  ·  #/social-compose
   ============================================================ */

#s-social-compose, #s-social-preview, #s-social-post { background: var(--surface-white) }

.so-cp-hdr {
    display: grid;
    grid-template-columns: 30px 1fr 30px;
    align-items: center;
    padding: 4px 16px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-weak)
}
.so-cp-hdr-title {
    text-align: center;
    font-size: var(--text-m);
    font-weight: var(--weight-bold);
    color: var(--ink-900)
}
.so-cp-x {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent
}
.so-cp-x:active { background: var(--surface-grey) }
.so-cp-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    background: var(--surface-white)
}
.so-cp-scroll::-webkit-scrollbar { display: none }

/* ── FLAT SECTIONS ────────────────────────────────────────── */
/* Instagram không lồng thẻ nổi trên nền xám: nền trắng suốt, các mục
   ngăn nhau bằng một nét kẻ mảnh. Ít khung, mắt đi thẳng vào nội dung. */
.so-cp-sec {
    padding: 16px;
    border-bottom: 1px solid var(--border-weak)
}
.so-cp-sec-t {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--ink-300);
    margin-bottom: 10px
}

/* ── MEDIA STRIP ──────────────────────────────────────────── */
.so-cp-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px
}
.so-cp-thumb,
.so-cp-add {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: var(--radius-s);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}
.so-cp-thumb { cursor: pointer }
.so-cp-thumb.cover { box-shadow: 0 0 0 2px var(--color-primary) }
/* Order number normally; the cover says so outright. */
.so-cp-thumb-tag {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px 0;
    background: rgba(26,26,46,.55);
    color: var(--surface-white);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    text-align: center;
    letter-spacing: .03em
}
.so-cp-thumb.cover .so-cp-thumb-tag { background: var(--color-primary) }
.so-cp-strip-hint {
    display: none;
    margin-top: 8px;
    font-size: var(--text-xs);
    color: var(--ink-300)
}
.so-cp-strip-hint.show { display: block }
.so-cp-thumb-x {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1.5px solid var(--surface-white);
    background: var(--ink-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0
}
.so-cp-thumb-x:active { background: var(--ink-900) }
.so-cp-thumb-vid {
    position: absolute;
    left: 5px;
    bottom: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(26,26,46,.55);
    display: flex;
    align-items: center;
    justify-content: center
}
.so-cp-add {
    border: 1.5px dashed var(--border-medium);
    background: none;
    cursor: pointer
}
.so-cp-add:active { background: var(--surface-grey) }

.so-cp-under {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px
}

/* ── SETTING ROWS ─────────────────────────────────────────── */
/* Icon trần, không ô nền — Instagram để icon đứng một mình cạnh nhãn. */
.so-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-weak);
    cursor: pointer
}
.so-row-last { border-bottom: 0 }
.so-row-ico {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center
}
.so-row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.so-row-t {
    flex: 1;
    font-size: var(--text-s);
    font-weight: var(--weight-medium);
    color: var(--ink-900)
}
.so-row-s { font-size: var(--text-xs); line-height: 1.4; color: var(--ink-300) }
/* Cover chooser — folds out under its row. */
/* Caption */
/* No inner border — the card around it already is the input. */
.so-cp-caption {
    width: 100%;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: var(--text-s);
    line-height: 1.5;
    color: var(--ink-900);
    resize: none;
    outline: none;
    background: none;
    min-height: 63px;      /* ba dòng lúc trống */
    max-height: 190px;     /* dài quá thì tự cuộn trong ô */
    overflow-y: auto
}
.so-cp-caption::-webkit-scrollbar { display: none }
.so-cp-caption::placeholder { color: var(--ink-300) }
.so-cp-count {
    font-size: var(--text-xs);
    color: var(--ink-300)
}
/* Sắp chạm trần 300 thì đậm lên, chạm rồi thì đỏ — báo trước khi ô ngừng nhận chữ. */
.so-cp-count.near { color: var(--ink-600); font-weight: var(--weight-semibold) }
.so-cp-count.full { color: var(--color-danger); font-weight: var(--weight-semibold) }
.so-cp-ai-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border: 1px solid var(--purple-100);
    border-radius: var(--radius-pill);
    background: var(--purple-15);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent
}
.so-cp-ai-btn:active { background: var(--purple-75) }

.so-cp-tone {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap
}
.so-cp-tone-lbl {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--ink-300);
    margin-right: 2px
}
.so-cp-tone-chip {
    padding: 5px 11px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-pill);
    background: var(--surface-white);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--ink-400);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all .15s
}
.so-cp-tone-chip.active {
    background: var(--purple-75);
    border-color: var(--purple-100);
    color: var(--color-primary)
}

.so-cp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px
}
.so-cp-tag {
    padding: 5px 10px;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-pill);
    background: var(--surface-white);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-400);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all .15s
}
.so-cp-tag.on {
    border-style: solid;
    border-color: var(--purple-100);
    background: var(--purple-75);
    color: var(--color-primary);
    font-weight: var(--weight-semibold)
}

/* Cross-post channel rows */
/* Checkbox */
/* Pin toggle */
.so-cp-switch {
    width: 42px;
    height: 25px;
    border-radius: var(--radius-pill);
    background: var(--border-medium);
    flex-shrink: 0;
    padding: 3px;
    transition: background .2s var(--ease-ios)
}
.so-cp-switch > span {
    display: block;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--surface-white);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s var(--ease-ios)
}
.so-cp-switch.on { background: var(--color-primary) }
.so-cp-switch.on > span { transform: translateX(17px) }

/* Instagram xếp "Save draft" cạnh nút đi tiếp ở đáy, không giấu trên header. */
.so-cp-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-weak);
    background: var(--surface-white)
}
.so-cp-draft { flex: 0 0 116px }
.so-cp-next { flex: 1 }
.so-cp-next:disabled {
    background: var(--border-medium);
    box-shadow: none;
    cursor: default
}

/* ============================================================
   REVIEW  ·  #/social-preview

   Last stop before publishing — the client's view, the item count,
   and the two ways out. There is no confirm modal after this: the
   screen itself is the confirmation.
   ============================================================ */

/* No device frame — the feed card fills the screen so it reads as the
   real thing rather than a mockup sitting inside a picture of a phone. */
.so-pv-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--ink-900)
}

.so-pv-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-weak);
    background: var(--surface-white)
}
.so-pv-edit { flex: 0 0 118px }   /* fits "Keep editing" on one line */
.so-pv-post { flex: 1 }

/* ── GCI REWARD FEED MOCK ──────────────────────────────────
   Chỉ dựng đúng phần bài đăng: ảnh, tên tiệm, caption, hàng nút.
   Không dựng status bar / ô search / chip / bottom nav của app GCI —
   người duyệt đang xem bài của mình, không phải xem app kia.  */
.so-gci {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #0B0B10;
    font-family: var(--font-family)
}
/* Swipeable media — one slide per photo, snapping like the real feed. */
.so-gci-track {
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab
}
.so-gci-track:active { cursor: grabbing }
.so-gci-track::-webkit-scrollbar { display: none }
.so-gci-slide {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: center;
    background: #14141C center/cover no-repeat
}

/* Clip phủ kín ô chứa nó, không bắt sự kiện để cú vuốt vẫn rơi xuống track. */
.so-vid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none
}
.so-gci-count {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold)
}
.so-gci-dots {
    display: flex;
    gap: 5px;
    margin: 2px 0 18px;       /* thở ra khỏi hàng nút bên dưới */
    pointer-events: auto      /* lớp phủ để lọt cú vuốt, riêng chấm vẫn bấm được */
}
.so-gci-dots > span {
    width: 6px;
    height: 6px;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255,255,255,.38);
    transition: background .18s, width .18s
}
.so-gci-dots > span.on { width: 16px; border-radius: 3px; background: #fff }

.so-gci-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,.30) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 40%, rgba(0,0,0,.85) 92%)
}
/* Lớp tối phụ, chỉ kéo lên khi caption mở: chữ lúc đó trèo tới giữa ảnh,
   nơi lớp scrim gốc đã trong suốt. Tách riêng để còn fade được. */
.so-gci-scrim-deep {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .22s ease;
    background: linear-gradient(180deg, rgba(0,0,0,0) 12%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.72) 70%)
}
.so-gci.cap-open .so-gci-scrim-deep { opacity: 1 }
/* Cả lớp chữ đè lên ảnh đều không bắt sự kiện, để vuốt chỗ nào cũng
   rơi xuống track ảnh bên dưới. Chỉ hàng chấm được bật lại. */
.so-gci-spacer { flex: 1; pointer-events: none }

.so-gci-info { position: relative; padding: 0 20px; pointer-events: none }
.so-gci-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px
}
.so-gci-name {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em
}
.so-gci-verified {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3B9BF5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}
.so-gci-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 600
}
.so-gci-rating-ico {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: #9B5CF6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}
.so-gci-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,.82);
    font-size: 14px;
    margin-bottom: 9px
}
/* Khối caption là chỗ duy nhất trong lớp phủ bấm được ngoài hàng chấm. */
.so-gci-cap-box { pointer-events: auto; margin-bottom: 14px }
.so-gci-cap {
    color: #fff;
    font-size: 14px;
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 20px;      /* đúng một dòng, để ô trống không sụp */
    white-space: pre-wrap    /* khối hashtag xuống dòng đúng như lúc soạn */
}
.so-gci-cap.empty { color: rgba(255,255,255,.45); font-style: italic }
/* Mở hết chữ, nhưng không cho nó nuốt cả tấm ảnh — quá tay thì cuộn trong ô. */
.so-gci-cap.open {
    display: block;
    max-height: 38vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch
}
.so-gci-cap.open::-webkit-scrollbar { display: none }
.so-gci-cap-more {
    display: block;
    margin-top: 3px;
    padding: 2px 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.72);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent
}
.so-gci-cap-more:active { color: #fff }
.so-gci-cap-more[hidden] { display: none }

.so-gci-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 20px 24px;
    pointer-events: none
}
.so-gci-act {
    width: 47px;
    height: 47px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}
.so-gci-book {
    flex: 1;
    height: 47px;
    border-radius: 100px;
    background: linear-gradient(135deg, #F2679C, #E8447C);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 600
}

/* ============================================================
   POST DETAIL  ·  #/social-post
   ============================================================ */

.so-dt-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 18px
}
.so-dt-scroll::-webkit-scrollbar { display: none }

/* Hàng hồ sơ trên đầu bài, đúng thứ tự Instagram: avatar → tên → nơi chốn. */
.so-dt-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px
}
.so-dt-ava {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--purple-100);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}
.so-dt-top-txt { flex: 1; min-width: 0 }
.so-dt-top-name {
    font-size: var(--text-s);
    font-weight: var(--weight-semibold);
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}
.so-dt-top-sub { font-size: var(--text-xs); color: var(--ink-300) }

/* Ảnh tràn viền, khung vuông kiểu Instagram. Không lấy 4:5 vì đây là màn
   xem số liệu — cao thêm 90px nữa là caption rơi xuống dưới nếp gấp. */
.so-dt-hero {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden
}
/* Bài nhiều ảnh thì vuốt được y như ở màn Review — cùng một hàm bind. */
.so-dt-track {
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab
}
.so-dt-track:active { cursor: grabbing }
.so-dt-track::-webkit-scrollbar { display: none }
.so-dt-slide {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: center;
    background: var(--surface-grey) center/cover no-repeat
}
/* Chấm chỉ số nằm dưới ảnh, canh giữa — đúng chỗ Instagram đặt. */
.so-dt-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 11px 0 3px
}
.so-dt-dots > span {
    width: 6px;
    height: 6px;
    cursor: pointer;
    border-radius: 50%;
    background: var(--border-medium);
    transition: background .18s, width .18s
}
.so-dt-dots > span.on { width: 16px; border-radius: 3px; background: var(--color-primary) }
.so-dt-hero-pin {
    position: absolute;
    top: 12px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--surface-white);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold)
}
/* Instagram đặt bộ đếm ảnh ở góc trên phải, không phải dưới. */
.so-dt-hero-count {
    position: absolute;
    right: 12px;
    top: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(0,0,0,.55);
    color: var(--surface-white);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold)
}

/* Hàng số liệu: icon nét + số, không ô nền — nhịp của hàng nút Instagram. */
.so-dt-metrics {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 16px 10px;
    font-size: var(--text-s);
    font-weight: var(--weight-semibold);
    color: var(--ink-900)
}
.so-dt-m { display: flex; align-items: center; gap: 6px }
.so-dt-m.book { margin-left: auto; color: var(--color-success-dark) }

.so-dt-body { padding: 0 16px 14px }
/* Tên tiệm in đậm đứng ngay đầu caption, đúng cách Instagram viết. */
.so-dt-cap {
    font-size: var(--text-s);
    line-height: 1.5;
    color: var(--ink-700)
}
.so-dt-cap > b { font-weight: var(--weight-semibold); color: var(--ink-900) }
.so-dt-cap.empty { color: var(--ink-300) }
.so-dt-cap.empty > b { font-style: normal }
.so-dt-time {
    margin-top: 6px;
    font-size: var(--text-xs);
    color: var(--ink-300)
}

.so-dt-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-weak);
    background: var(--surface-white)
}
.so-dt-actions .btn { flex: 1 }

/* ============================================================
   POST ACTION SHEET  ·  lives in the shell (index.html)
   ============================================================ */

.so-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 94;
    pointer-events: none;
    transition: background .25s ease
}
.so-sheet-backdrop.open { background: rgba(0,0,0,.4); pointer-events: all }

.so-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: var(--surface-white);
    border-radius: 20px 20px 0 0;
    padding: 8px 16px 20px;
    transform: translateY(100%);
    transition: transform var(--duration-sheet) var(--ease-ios);
    box-shadow: var(--shadow-sheet)
}
.so-sheet.open { transform: translateY(0) }
.so-sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-medium);
    margin: 4px auto 10px
}
.so-sheet-act {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 8px;
    border: 0;
    border-radius: var(--radius-m);
    background: none;
    font-family: inherit;
    font-size: var(--text-s);
    font-weight: var(--weight-medium);
    color: var(--ink-600);
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent
}
.so-sheet-act:active { background: var(--surface-grey) }
.so-sheet-act.danger { color: var(--color-danger) }
.so-sheet-act-ico {
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}
.so-sheet-div {
    height: 1px;
    background: var(--border-weak);
    margin: 6px 0
}
