:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #6b6b6b;
    --line: #dbdbdb;
    --line-soft: #efefef;
    --panel: #ffffff;
    --shadow: 0 18px 40px rgba(17, 17, 17, .14);
    --accent-a: #f09433;
    --accent-b: #dc2743;
    --accent-c: #cc2366;
    --accent-d: #bc1888;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: Inter, Arial, Helvetica, sans-serif; }
body.is-locked { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.mobile-topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 16px; background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line-soft); backdrop-filter: blur(12px);
}
.mobile-topbar__brand { font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.mobile-topbar__meta { font-size: 14px; color: var(--muted); }

.feed-page { max-width: 980px; margin: 0 auto; }
.profile-hero { padding: 24px 24px 10px; }
.profile-hero__main {
    display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: center;
    padding-bottom: 18px; border-bottom: 1px solid var(--line-soft);
}
.profile-avatar-wrap { display: flex; justify-content: center; }
.profile-avatar-ring {
    width: 166px; height: 166px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-a), var(--accent-b), var(--accent-c), var(--accent-d));
    padding: 5px; display: grid; place-items: center;
}
.profile-avatar {
    width: 100%; height: 100%; border-radius: 50%;
    display: grid; place-items: center; background: #fff;
    font-size: 56px; font-weight: 800; letter-spacing: -.04em;
}
.profile-headline {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px;
}
.profile-headline h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.profile-handle { color: var(--muted); margin-top: 6px; }
.profile-follow-btn {
    min-height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
    background: #fafafa; font-weight: 700;
}
.profile-stats__row { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.profile-stats__row div { display: flex; gap: 6px; align-items: baseline; }
.profile-stats__row strong { font-size: 18px; }
.profile-stats__row span { color: var(--muted); }
.profile-bio { max-width: 620px; }
.profile-bio strong { display: block; margin-bottom: 8px; }
.profile-bio p { margin: 0; line-height: 1.55; }

.stories-panel { padding-top: 18px; }
.stories-panel__title { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.stories {
    display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px;
    scrollbar-width: thin;
}
.story-chip {
    border: 0; background: transparent; padding: 0; flex: 0 0 auto; width: 92px;
    display: flex; flex-direction: column; align-items: center; color: var(--text);
}
.story-chip__ring {
    width: 78px; height: 78px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-a), var(--accent-b), var(--accent-d));
    padding: 3px; display: grid; place-items: center; margin-bottom: 8px;
}
.story-chip__icon {
    width: 100%; height: 100%; border-radius: 50%; background: #fff;
    display: grid; place-items: center; font-size: 28px;
}
.story-chip__label {
    font-size: 12px; line-height: 1.25; text-align: center;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.feed-grid-wrap { padding: 0 24px 40px; }
.feed-tabs {
    display: flex; justify-content: center; gap: 18px; border-top: 1px solid var(--line-soft);
    margin-top: 10px; padding-top: 14px; margin-bottom: 14px;
}
.feed-tab {
    border: 0; background: transparent; color: #8d8d8d; text-transform: uppercase;
    font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 6px 2px;
}
.feed-tabs .feed-tab:only-child { color: var(--text); }
.feed-tab.is-active { color: var(--text); }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.product-tile { position: relative; background: #f2f2f2; overflow: hidden; }
.product-tile__open { border: 0; padding: 0; display: block; width: 100%; background: transparent; }
.product-tile__open::before { content: ''; display: block; padding-top: 100%; }
.product-tile img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.tile-overlay {
    position: absolute; inset: auto 0 0 0; z-index: 2;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.48) 100%);
}
.tile-like-btn, .tile-comment-btn {
    border: 0; background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(10px);
    min-height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.tile-like-btn.is-active, .post-action-btn.is-active { color: #e0316a; }

.overlay {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: stretch; justify-content: center;
    padding: 0;
}
.overlay.is-hidden { display: none; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); }
.overlay-close {
    position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px;
    border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px;
}

.post-sheet {
    position: relative; z-index: 1; width: min(1100px, 100%); min-height: 100dvh; background: #fff;
    overflow: hidden; display: grid; grid-template-columns: minmax(320px, 1.1fr) 380px; box-shadow: var(--shadow);
}
.post-sheet__media {
    position: relative; background: #080808; min-height: 100%; display: flex; align-items: center; justify-content: center;
}
.post-sheet__media img { width: 100%; height: 100%; max-height: 100dvh; object-fit: contain; }
.post-sheet__dots {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
    display: flex; gap: 8px;
}
.media-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0;
    display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 28px;
    background: rgba(255,255,255,.84); color: #1d1d1d;
}
.media-nav.prev { left: 16px; }
.media-nav.next { right: 16px; }
.media-count {
    position: absolute; right: 16px; top: 16px; z-index: 2; display: inline-flex; align-items: center; min-height: 32px;
    padding: 0 12px; border-radius: 999px; background: rgba(0,0,0,.38); color: #fff; font-size: 13px; font-weight: 700;
}
.post-dot {
    width: 8px; height: 8px; border-radius: 50%; border: 0; background: rgba(255,255,255,.45);
}
.post-dot.is-active { background: #fff; }
.post-sheet__body { padding: 28px 24px 24px; display: flex; flex-direction: column; }
.post-sheet__body--classic { padding-top: 72px; }
.post-sheet__topline {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 18px;
    border-bottom: 1px solid var(--line-soft);
}
.mini-profile { display: flex; align-items: center; gap: 12px; }
.mini-profile__avatar {
    width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-a), var(--accent-d));
    display: grid; place-items: center; color: #fff; font-weight: 800;
}
.mini-profile strong, .mini-profile span { display: block; }
.mini-profile span, .post-article { color: var(--muted); font-size: 13px; }
.post-actions { display: flex; gap: 10px; margin: 18px 0 16px; }
.post-action-btn {
    border: 0; background: transparent; padding: 0; font-size: 24px; display: inline-flex; gap: 6px; align-items: center;
}
.post-action-btn span { font-size: 15px; color: var(--text); }
.post-sheet__body h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.15; }
.post-price { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.post-description { margin: 0; color: #3a3a3a; line-height: 1.6; }

.comments-sheet {
    position: relative; z-index: 2; width: min(520px, 100%); max-height: min(88vh, 820px);
    background: #fff; border-radius: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column;
    overflow: hidden;
}
.comments-sheet__header {
    position: sticky; top: 0; z-index: 2; background: #fff; padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line-soft);
}
.comments-sheet__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.comments-sheet__header h3 { margin: 6px 0 0; font-size: 22px; }
.comments-close { top: 16px; right: 16px; }
.comments-list { padding: 14px 20px; overflow: auto; flex: 1; }
.comment-item { display: flex; gap: 12px; padding: 12px 0; }
.comment-item + .comment-item { border-top: 1px solid var(--line-soft); }
.comment-item__avatar {
    width: 36px; height: 36px; border-radius: 50%; background: #f2f2f2; flex: 0 0 auto;
    display: grid; place-items: center; font-weight: 800;
}
.comment-item__line { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.comment-item__line span { color: var(--muted); font-size: 12px; }
.comment-item__body p { margin: 0; line-height: 1.5; }
.comment-empty {
    min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: var(--muted); gap: 8px;
}
.comment-empty__icon { font-size: 30px; }
.comment-form {
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft); background: #fff; display: grid; gap: 10px;
}
.comment-input {
    width: 100%; border-radius: 14px; border: 1px solid var(--line); background: #fafafa;
    padding: 12px 14px; outline: none;
}
.comment-input:focus { border-color: #9d9d9d; background: #fff; }
.comment-input--text { min-height: 90px; resize: vertical; }
.comment-submit {
    justify-self: end; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 0;
    color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--accent-b), var(--accent-d));
}

@media (max-width: 900px) {
    .feed-page { max-width: none; }
    .profile-hero { padding: 14px 0 0; }
    .profile-hero__main {
        grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 0 16px 16px;
    }
    .profile-avatar-ring { width: 86px; height: 86px; }
    .profile-avatar { font-size: 28px; }
    .profile-headline { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
    .profile-headline h1 { font-size: 24px; }
    .profile-follow-btn { min-height: 34px; padding: 0 12px; border-radius: 8px; }
    .profile-stats__row { gap: 14px; margin-bottom: 12px; }
    .profile-stats__row strong { font-size: 16px; }
    .profile-bio { font-size: 14px; }
    .stories-panel { padding: 0 12px 12px; }
    .story-chip { width: 78px; }
    .story-chip__ring { width: 68px; height: 68px; }
    .story-chip__icon { font-size: 24px; }
    .feed-grid-wrap { padding: 0 0 24px; }
    .feed-tabs { margin: 0; padding: 12px 0 8px; }
    .product-grid { gap: 1px; }
    .tile-overlay { padding: 8px 6px; }
    .tile-like-btn, .tile-comment-btn { min-height: 28px; padding: 0 8px; font-size: 11px; }
    .overlay { padding: 0; align-items: stretch; }
    .post-sheet {
        width: 100%; min-height: 100dvh; border-radius: 0; grid-template-columns: 1fr;
    }
    .post-sheet__media { min-height: 58dvh; }
    .post-sheet__media img { max-height: 58dvh; }
    .post-sheet__body { padding: 20px 16px calc(22px + env(safe-area-inset-bottom)); }
    .post-sheet__body--classic { padding-top: 20px; }
    .media-nav { width: 40px; height: 40px; font-size: 24px; }
    .comments-sheet {
        width: 100%; max-height: 86dvh; border-radius: 24px 24px 0 0;
    }
    .comments-sheet__header { padding: 18px 16px 12px; }
    .comments-list { padding: 12px 16px; }
}


.reel-sheet {
    position: relative; z-index: 1; width: min(1100px, 100%); min-height: 100dvh; background: #fff;
    overflow: hidden; box-shadow: var(--shadow);
}
.reel-viewport { position: relative; height: 100dvh; overflow: hidden; background: #fff; }
.reel-track { height: 100%; width: 100%; will-change: transform; }
.reel-card {
    height: 100dvh; display: grid; grid-template-columns: minmax(320px, 1.1fr) 380px; background: #fff;
}
.reel-card__media-shell { position: relative; background: #080808; min-height: 100%; overflow: hidden; }
.reel-card__media-viewport { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: pan-y pinch-zoom; }
.reel-card__media-track { display: flex; height: 100%; width: 100%; will-change: transform; transition: transform .34s cubic-bezier(.22,.9,.2,1); }
.reel-card__media-item { min-width: 100%; height: 100%; flex: 0 0 100%; }
.reel-card__media-item img { width: 100%; height: 100%; max-height: 100dvh; object-fit: contain; display: block; }
.reel-card__body { padding: 72px 24px 24px; display: flex; flex-direction: column; }
.post-sheet__dots--reel { bottom: 16px; }
.media-count--reel { top: 16px; right: 16px; }
@media (max-width: 900px) {
  .reel-card { grid-template-columns: 1fr; }
  .reel-card__media-shell { min-height: 58dvh; }
  .reel-card__media-item img { max-height: 58dvh; }
  .reel-card__body { padding: 20px 16px calc(22px + env(safe-area-inset-bottom)); }
  .reel-card__media-viewport { touch-action: pan-y; }
}



/* compact one-row variant selector */
.variant-strip{
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 8px 0 14px;
}
.variant-window{
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.variant-chip--window{
    min-width: 0;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,.16);
    background: rgba(255,255,255,.78);
    color: #111827;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}
.variant-chip--window .variant-chip__text{
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.variant-chip--window.is-active{
    background: rgba(236,72,153,.12);
    border-color: rgba(236,72,153,.34);
    color: #9d174d;
    font-weight: 700;
}
.variant-chip--ghost{
    visibility: hidden;
    min-height: 40px;
}
.variant-more{
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(17,24,39,.06);
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}
.variant-more.is-hidden{
    visibility: hidden;
}
@media (max-width: 900px){
    .variant-strip{
        margin: 6px 0 12px;
    }
    .variant-window{
        gap: 6px;
    }
    .variant-chip--window{
        min-height: 36px;
        padding: 8px 6px;
        font-size: 13px;
    }
    .variant-more{
        min-width: 40px;
        height: 30px;
        padding: 0 8px;
        font-size: 12px;
    }
}


.story-chip__img{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
}


.profile-cart-btn { display: inline-flex; align-items: center; gap: 8px; }
.cart-badge {
    min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-b), var(--accent-d)); color: #fff; font-size: 12px; font-weight: 800;
}
.overlay--cart { align-items: flex-end; }
.cart-sheet {
    position: relative; z-index: 2; width: min(620px, 100%); max-height: min(92dvh, 900px); background: #fff;
    border-radius: 28px 28px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.cart-sheet__handle {
    width: 54px; height: 5px; border-radius: 999px; background: #d8d8d8; margin: 10px auto 0;
}
.cart-sheet__header {
    position: sticky; top: 0; z-index: 2; background: #fff; padding: 16px 18px 14px; border-bottom: 1px solid var(--line-soft);
}
.cart-sheet__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cart-sheet__header h3 { margin: 6px 0 0; font-size: 24px; }
.cart-close { top: 14px; right: 14px; }
.cart-sheet__body { padding: 14px 16px; overflow: auto; flex: 1; }
.cart-list { display: grid; gap: 12px; }
.cart-item {
    display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 18px; background: #fff;
}
.cart-item__media { width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: #f4f4f4; }
.cart-item__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item__placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 30px; }
.cart-item__body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cart-item__title { font-weight: 800; line-height: 1.3; }
.cart-item__meta { color: var(--muted); font-size: 13px; }
.cart-item__bottom { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.cart-item__price { font-weight: 800; }
.cart-item__controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-qty-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1;
}
.cart-qty-value { min-width: 18px; text-align: center; font-weight: 700; }
.cart-remove-btn {
    margin-left: auto; border: 0; background: transparent; color: #b44b60; font-weight: 700; padding: 0;
}
.cart-empty {
    min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 10px;
}
.cart-empty__icon { font-size: 34px; }
.cart-sheet__footer {
    border-top: 1px solid var(--line-soft); background: #fff; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 14px;
}
.cart-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-summary span { color: var(--muted); }
.cart-summary strong { font-size: 22px; }
.cart-actions { display: grid; gap: 10px; }
.cart-action-btn {
    min-height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 0 16px; text-align: center; text-decoration: none; font-weight: 800;
}
.cart-action-btn--primary { color: #fff; background: linear-gradient(135deg, var(--accent-b), var(--accent-d)); }
.cart-action-btn--secondary { color: var(--text); background: #f5f5f5; border: 1px solid var(--line-soft); }
@media (max-width: 900px) {
    .cart-sheet { width: 100%; max-height: 88dvh; }
    .cart-sheet__header { padding: 14px 16px 12px; }
    .cart-sheet__body { padding: 12px; }
    .cart-item { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 10px; }
    .cart-item__media { width: 76px; height: 76px; }
    .cart-summary strong { font-size: 20px; }
}
