:root {
    --sh-bg: #050505;
    --sh-surface: rgba(10, 10, 12, 0.9);
    --sh-surface-strong: rgba(12, 12, 14, 0.98);
    --sh-border: rgba(255, 255, 255, 0.1);
    --sh-border-strong: rgba(255, 255, 255, 0.2);
    --sh-text: #f8fafc;
    --sh-muted: #a1a1aa;
    --sh-faint: #71717a;
    --sh-accent: #d4af37;
    --sh-accent-2: #c8ccd2;
    --sh-accent-3: #f8fafc;
    --sh-good: #34d399;
    --sh-danger: #fb7185;
    --sh-radius: 8px;
    --sh-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: var(--sh-font);
    color: var(--sh-text);
    background: var(--sh-bg);
    overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.sh-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sh-svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sh-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(360px, 1fr);
    gap: 0;
    padding: 0;
    direction: ltr;
}

.sh-sidebar {
    direction: rtl;
    min-height: 100vh;
}

.sh-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 16px;
    border-right: 1px solid var(--sh-border);
    background: #050505;
}

.sh-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
}

.sh-brand-mark {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sh-accent), var(--sh-accent-2));
    color: #031015;
    font-weight: 900;
    letter-spacing: 0;
}

.sh-brand strong,
.sh-brand small {
    display: block;
}

.sh-brand strong {
    font-size: 1.08rem;
    letter-spacing: 0;
}

.sh-brand small {
    margin-top: 3px;
    color: var(--sh-muted);
    font-size: 0.78rem;
}

.sh-side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sh-nav-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--sh-muted);
    text-align: right;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sh-nav-btn:hover,
.sh-nav-btn.active {
    color: var(--sh-text);
    background: rgba(255, 255, 255, 0.1);
}

.sh-nav-btn.active {
    background: rgba(255, 255, 255, 0.12);
}

.sh-ico {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: var(--sh-text);
}

.sh-ico .sh-svg {
    width: 18px;
    height: 18px;
}

.sh-viewer-note {
    margin-top: auto;
    padding: 14px 12px;
    border-top: 1px solid var(--sh-border);
}

.sh-viewer-note strong,
.sh-viewer-note small {
    display: block;
}

.sh-viewer-note strong {
    margin-bottom: 5px;
}

.sh-viewer-note small {
    color: var(--sh-muted);
    line-height: 1.5;
}

.sh-main {
    position: relative;
    min-width: 0;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 18px 90px 18px 18px;
}

.sh-desktop-mute-btn {
    position: absolute;
    top: 22px;
    right: 24px;
    z-index: 12;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,0.32);
    backdrop-filter: blur(14px);
    font-size: 1.08rem;
}

.sh-desktop-mute-btn:hover {
    border-color: rgba(255,255,255,0.34);
    background: rgba(255,255,255,0.14);
}

.sh-desktop-mute-btn .sh-svg {
    width: 20px;
    height: 20px;
}

.sh-phone-shell {
    position: relative;
    width: min(430px, 100%);
    height: calc(100vh - 36px);
    max-height: 920px;
    border-radius: 12px;
    padding: 0;
    background: #050505;
    box-shadow: 0 20px 70px rgba(0,0,0,0.42);
    border: 1px solid rgba(255,255,255,0.08);
}

.sh-phone-shell::before {
    display: none;
}

.sh-feed {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    border-radius: 12px;
    background: #020307;
    scrollbar-width: none;
}

.sh-feed::-webkit-scrollbar { display: none; }

.sh-reel {
    position: relative;
    height: 100%;
    scroll-snap-align: start;
    overflow: hidden;
    background: #050509;
}

.sh-reel video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #050509;
}

.sh-reel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.82), transparent 34%, rgba(0,0,0,0.32));
}

.sh-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.16);
}

.sh-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--sh-accent), var(--sh-accent-2));
}

.sh-caption {
    position: absolute;
    left: 16px;
    right: 88px;
    bottom: 24px;
    z-index: 4;
    direction: rtl;
}

.sh-user-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
}

.sh-avatar {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sh-accent), var(--sh-accent-2));
    color: #fff;
    font-weight: 800;
    border: 2px solid rgba(255,255,255,0.68);
}

.sh-user-row strong {
    font-size: 0.94rem;
}

.sh-follow {
    margin-inline-start: 6px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.sh-caption p {
    margin: 0 0 8px;
    color: rgba(255,255,255,0.92);
    font-size: 0.9rem;
    line-height: 1.5;
}

.sh-audio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    color: rgba(255,255,255,0.84);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-audio-icon {
    flex: 0 0 auto;
    color: var(--sh-accent);
}

.sh-actions {
    position: absolute;
    right: 14px;
    left: auto;
    bottom: 22px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
}

.sh-action-btn {
    display: grid;
    place-items: center;
    gap: 5px;
    min-width: 48px;
    border: 0;
    background: transparent;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.sh-action-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    transition: transform 160ms ease, color 160ms ease;
}

.sh-action-icon .sh-svg {
    width: 26px;
    height: 26px;
}

.sh-action-btn:hover .sh-action-icon {
    transform: translateY(-2px) scale(1.04);
}

.sh-action-btn.is-on .sh-action-icon,
.sh-action-btn[data-action="like"].is-on .sh-action-icon {
    color: var(--sh-accent);
}

.sh-action-btn small {
    color: rgba(255,255,255,0.92);
    font-size: 0.72rem;
    font-weight: 700;
}

.sh-disc {
    width: 44px;
    height: 44px;
    margin-top: 2px;
    border-radius: 50%;
    background:
        radial-gradient(circle, #030305 0 21%, transparent 22%),
        conic-gradient(from 0deg, var(--sh-accent), var(--sh-accent-3), var(--sh-accent-2), var(--sh-accent));
    border: 4px solid rgba(255,255,255,0.2);
    animation: shSpin 5s linear infinite;
}

@keyframes shSpin { to { transform: rotate(360deg); } }

.sh-heart-pop {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 6;
    transform: translate(-50%, -50%) scale(0.6);
    color: white;
    font-size: 5rem;
    filter: drop-shadow(0 12px 28px rgba(0,0,0,0.32));
    pointer-events: none;
    animation: shHeartPop 700ms ease forwards;
}

.sh-heart-pop .sh-svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    stroke: currentColor;
}

@keyframes shHeartPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
    35% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -62%) scale(1.28); }
}

.sh-empty {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 28px;
    text-align: center;
    direction: rtl;
}

.sh-empty-card {
    width: min(300px, 100%);
    padding: 28px 22px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.sh-empty-card h1 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.sh-empty-card p {
    margin: 0 0 18px;
    color: var(--sh-muted);
    line-height: 1.65;
}

.sh-info-panel { display: none; }

.sh-panel-card {
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    background: var(--sh-surface);
    backdrop-filter: blur(22px);
    padding: 16px;
}

.sh-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--sh-text);
    font-weight: 800;
}

.sh-panel-title a {
    color: var(--sh-accent);
    font-size: 0.8rem;
}

.sh-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sh-stats-grid div {
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 12px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    background: rgba(255,255,255,0.06);
}

.sh-stats-grid strong {
    font-size: 1.35rem;
}

.sh-stats-grid span {
    color: var(--sh-muted);
    font-size: 0.78rem;
}

.sh-shortcuts {
    display: grid;
    gap: 8px;
}

.sh-shortcuts span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--sh-muted);
    font-size: 0.86rem;
}

kbd {
    min-width: 36px;
    padding: 3px 7px;
    border: 1px solid var(--sh-border-strong);
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: var(--sh-text);
    text-align: center;
    font-size: 0.75rem;
}

.sh-recent-list {
    display: grid;
    gap: 9px;
}

.sh-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    background: rgba(255,255,255,0.05);
}

.sh-recent-thumb {
    width: 42px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(34,211,238,0.3), rgba(244,63,94,0.28));
}

.sh-recent-copy {
    min-width: 0;
    flex: 1;
}

.sh-recent-copy strong,
.sh-recent-copy span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sh-recent-copy strong { font-size: 0.86rem; }
.sh-recent-copy span { color: var(--sh-muted); font-size: 0.74rem; margin-top: 2px; }

.sh-mobile-top,
.sh-bottom-nav {
    display: none;
}

.sh-comments-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.sh-comments-sheet.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sh-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0,0,0,0.62);
}

.sh-sheet-panel {
    position: absolute;
    left: 50%;
    bottom: 18px;
    width: min(430px, calc(100vw - 24px));
    max-height: min(640px, 78vh);
    display: flex;
    flex-direction: column;
    transform: translate(-50%, 28px);
    border: 1px solid var(--sh-border);
    border-radius: 18px;
    background: var(--sh-surface-strong);
    backdrop-filter: blur(24px);
    direction: rtl;
    overflow: hidden;
    transition: transform 180ms ease;
}

.sh-comments-sheet.is-open .sh-sheet-panel {
    transform: translate(-50%, 0);
}

.sh-sheet-handle {
    width: 44px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 99px;
    background: rgba(255,255,255,0.24);
}

.sh-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sh-border);
}

.sh-sheet-header h2 {
    margin: 0;
    font-size: 1rem;
}

.sh-sheet-header button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--sh-text);
    display: inline-grid;
    place-items: center;
}

.sh-sheet-header button .sh-svg {
    width: 18px;
    height: 18px;
}

.sh-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.sh-comment {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sh-comment strong {
    display: block;
    font-size: 0.84rem;
    margin-bottom: 3px;
}

.sh-comment p {
    margin: 0;
    color: var(--sh-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.sh-comment-form {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--sh-border);
}

.sh-comment-form input {
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    background: rgba(255,255,255,0.08);
    color: var(--sh-text);
    outline: none;
}

.sh-comment-form button {
    min-width: 70px;
    border: 0;
    border-radius: var(--sh-radius);
    background: var(--sh-accent);
    color: #031015;
    font-weight: 800;
}

.sh-toast-root {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 80;
    display: grid;
    gap: 8px;
    direction: rtl;
}

.sh-toast {
    min-width: 220px;
    max-width: 320px;
    padding: 12px 14px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    background: var(--sh-surface-strong);
    color: var(--sh-text);
    box-shadow: 0 16px 42px rgba(0,0,0,0.34);
    animation: shToast 260ms ease both;
}

@keyframes shToast {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
    :root {
        --sh-mobile-nav-height: 34px;
    }

    .sh-app {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 0;
    }

    .sh-sidebar,
    .sh-info-panel {
        display: none;
    }

    .sh-main {
        min-height: calc(100vh - var(--sh-mobile-nav-height) - env(safe-area-inset-bottom));
        min-height: calc(100dvh - var(--sh-mobile-nav-height) - env(safe-area-inset-bottom));
        padding: 0 0 calc(var(--sh-mobile-nav-height) + env(safe-area-inset-bottom));
        align-items: start;
    }

    .sh-phone-shell {
        width: 100vw;
        height: calc(100vh - var(--sh-mobile-nav-height) - env(safe-area-inset-bottom));
        height: calc(100dvh - var(--sh-mobile-nav-height) - env(safe-area-inset-bottom));
        max-height: none;
        border-radius: 0;
        padding: 0;
        background: #020307;
        border: 0;
    }

    .sh-phone-shell::before {
        display: none;
    }

    .sh-feed {
        border-radius: 0;
    }

    .sh-mobile-top,
    .sh-bottom-nav {
        display: flex;
        position: fixed;
        z-index: 20;
        left: 0;
        right: 0;
        direction: rtl;
    }

    .sh-mobile-top {
        top: 0;
        align-items: center;
        justify-content: space-between;
        padding: calc(env(safe-area-inset-top) + 12px) 14px 10px;
        pointer-events: none;
    }

    .sh-mobile-top > * {
        pointer-events: auto;
    }

    .sh-mobile-logo {
        font-weight: 900;
        letter-spacing: 0;
        text-shadow: 0 2px 18px rgba(0,0,0,0.5);
    }

    .sh-mobile-actions {
        display: flex;
        gap: 8px;
    }

    .sh-round-btn {
        width: 34px;
        height: 34px;
        display: inline-grid;
        place-items: center;
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 50%;
        background: rgba(0,0,0,0.28);
        color: #fff;
        backdrop-filter: blur(12px);
    }

    .sh-round-btn .sh-svg {
        width: 17px;
        height: 17px;
    }

    .sh-desktop-mute-btn {
        display: none;
    }

    .sh-bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        bottom: 0;
        min-height: calc(var(--sh-mobile-nav-height) + env(safe-area-inset-bottom));
        align-items: center;
        padding: 3px 6px calc(env(safe-area-inset-bottom) + 3px);
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.96);
        backdrop-filter: blur(18px);
        direction: ltr;
    }

    .sh-bottom-nav button,
    .sh-bottom-nav a {
        width: 100%;
        min-width: 0;
        display: grid;
        place-items: center;
        gap: 0;
        border: 0;
        background: transparent;
        color: rgba(255,255,255,0.75);
        overflow: hidden;
        text-align: center;
    }

    .sh-bottom-nav span {
        font-size: 1rem;
        line-height: 1;
    }

    .sh-bottom-nav span .sh-svg {
        width: 15px;
        height: 15px;
    }

    .sh-bottom-nav small {
        display: none;
    }

    .sh-bottom-nav .active,
    .sh-bottom-nav button.active {
        color: #fff;
    }

    .sh-caption {
        bottom: 18px;
        left: 14px;
        right: 84px;
    }

    .sh-actions {
        bottom: 22px;
        right: 10px;
        left: auto;
    }

    .sh-sheet-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 80vh;
        transform: translateY(28px);
        border-radius: 18px 18px 0 0;
    }

    .sh-comments-sheet.is-open .sh-sheet-panel {
        transform: translateY(0);
    }

    .sh-comment-form {
        grid-template-columns: 1fr auto;
    }

    .sh-comment-form #commentAuthor {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .sh-action-icon {
        width: 28px;
        height: 28px;
    }

    .sh-action-icon .sh-svg {
        width: 24px;
        height: 24px;
    }

    .sh-actions {
        gap: 10px;
    }

    .sh-caption p {
        font-size: 0.84rem;
    }
}
