/* Homepage Stories — row + viewer + upload modal */

.tl-home-stories__row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 4px 0 10px;
    min-height: 96px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    direction: ltr;
    justify-content: flex-start;
}
.tl-home-stories__row.is-rtl .tl-home-stories__label {
    direction: rtl;
}
.tl-home-stories__row::-webkit-scrollbar {
    display: none;
}
.tl-home-stories__row.is-empty {
    justify-content: center;
    overflow-x: hidden;
}
.tl-home-stories__empty {
    margin: 0 auto;
    width: 100%;
    text-align: center;
    font-size: 0.84rem;
    color: var(--text-muted, #9ca3af);
    padding: 20px 0;
}
.tl-home-stories__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 72px;
    max-width: 88px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit;
}
.tl-home-stories__ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #6b9fff, #1e56f5);
    box-shadow: 0 4px 14px rgba(30, 86, 245, 0.22);
}
.tl-home-stories__item--add .tl-home-stories__ring {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}
.tl-home-stories__avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(8, 10, 18, 0.92);
    background-color: var(--bg-elev-2, #1a1a22);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #fff;
    font-size: 1.25rem;
    overflow: hidden;
}
.tl-home-stories__avatar--media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    pointer-events: none;
}
.tl-home-stories__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 50%;
}
.tl-home-stories__ring--progress {
    background: conic-gradient(#1e56f5 0deg, #1e56f5 calc(var(--tl-story-progress, 0) * 3.6deg), rgba(255, 255, 255, 0.14) calc(var(--tl-story-progress, 0) * 3.6deg));
    transition: --tl-story-progress 0.2s ease;
}
.tl-home-stories__ring--error {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
}
.tl-home-stories__avatar--error {
    background: rgba(127, 29, 29, 0.55) !important;
    color: #fecaca;
    font-size: 1.1rem;
}
.tl-home-stories__label--error {
    color: #f87171 !important;
    font-weight: 700;
}
.tl-home-stories__item--uploading {
    cursor: wait;
    opacity: 0.95;
}
.tl-home-stories__item--error {
    cursor: pointer;
}
.tl-home-stories__item--error:hover .tl-home-stories__ring--error {
    transform: scale(1.05);
}
.tl-home-stories__avatar--add {
    background: rgba(30, 86, 245, 0.15);
    color: #60a5fa;
}
.tl-home-stories__item.is-seen .tl-home-stories__ring {
    background: linear-gradient(135deg, #8b93a7, #5c6578);
    box-shadow: none;
}
.tl-home-stories__item--own .tl-home-stories__ring {
    position: relative;
}
.tl-home-stories__mini-add {
    position: absolute;
    inset-inline-end: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1e56f5;
    border: 2px solid var(--bg, #0d0d12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(30, 86, 245, 0.45);
}
.tl-home-stories__mini-add:hover {
    background: #5280ff;
}
.tl-home-stories__label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text, #e8e8e8);
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Story viewer — Digikala-style */
body.tl-story-viewer-open {
    overflow: hidden;
}
.tl-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-story-viewer[hidden] {
    display: none !important;
}
.tl-story-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}
.tl-story-viewer__phone {
    position: relative;
    width: min(380px, 92vw);
    height: min(680px, 88vh);
    border-radius: 16px;
    overflow: hidden;
    background: #0a0a0f;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
    z-index: 2;
    display: flex;
    flex-direction: column;
}
.tl-story-viewer__progress {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 4;
}
.tl-story-viewer__prog {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}
.tl-story-viewer__prog span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 2px;
}
.tl-story-viewer__prog.is-done span {
    width: 100%;
}
.tl-story-viewer__prog.is-active span {
    animation: tlStoryProg var(--tl-story-dur, 5s) linear forwards;
}
@keyframes tlStoryProg {
    from { width: 0; }
    to { width: 100%; }
}
.tl-story-viewer__top {
    position: absolute;
    top: 20px;
    left: 12px;
    right: 12px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tl-story-viewer__prog.is-active.is-paused span {
    animation-play-state: paused;
}
.tl-story-viewer__av-link {
    flex-shrink: 0;
    display: block;
    line-height: 0;
    border-radius: 50%;
    text-decoration: none;
}
.tl-story-viewer__av-link:hover .tl-story-viewer__av {
    border-color: rgba(255, 255, 255, 0.65);
}
.tl-story-viewer__av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.15s ease;
    display: block;
}
.tl-story-viewer__meta {
    flex: 1;
    min-width: 0;
}
.tl-story-viewer__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-decoration: none;
}
.tl-story-viewer__name:hover {
    text-decoration: underline;
}
.tl-story-viewer__views {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    z-index: 4;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
    pointer-events: none;
    padding: 0 12px;
}
.tl-story-viewer__follow {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(30, 86, 245, 0.88);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.tl-story-viewer__follow.tl-story-follow-nudge {
    animation: tlStoryFollowPulse 2.4s ease-in-out infinite;
}
@keyframes tlStoryFollowPulse {
    0%, 100% {
        background: rgba(30, 86, 245, 0.88);
        box-shadow: 0 0 0 0 rgba(30, 86, 245, 0.45);
        transform: scale(1);
    }
    50% {
        background: rgba(59, 130, 246, 0.98);
        box-shadow: 0 0 0 6px rgba(30, 86, 245, 0);
        transform: scale(1.04);
    }
}
.tl-story-viewer__follow.is-following {
    opacity: 0.7;
}
.tl-story-viewer__ban {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(180, 83, 9, 0.9);
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    margin-inline-end: 4px;
}
.tl-story-viewer__ban:hover {
    background: rgba(217, 119, 6, 0.95);
}
.tl-story-viewer__ban.is-banned {
    background: rgba(22, 163, 74, 0.9);
}
.tl-story-viewer__ban.is-banned:hover {
    background: rgba(34, 197, 94, 0.95);
}
.tl-story-viewer__delete {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.85);
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    margin-inline-end: 4px;
}
.tl-story-viewer__delete:hover {
    background: rgba(239, 68, 68, 0.95);
}
.tl-story-viewer__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}
.tl-story-viewer__media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    position: relative;
}
.tl-story-viewer__img,
.tl-story-viewer__vid {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tl-story-viewer__heart-burst {
    position: absolute;
    transform: translate(-50%, -50%) scale(0.2);
    color: #f43f5e;
    font-size: clamp(3.5rem, 18vw, 5rem);
    pointer-events: none;
    z-index: 8;
    animation: tlStoryHeartPop 0.85s ease-out forwards;
    text-shadow: 0 4px 24px rgba(244, 63, 94, 0.45);
}
@keyframes tlStoryHeartPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    30% { transform: translate(-50%, -50%) scale(0.95); }
    45% { transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}
.tl-story-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.tl-story-viewer__nav--prev {
    left: max(12px, calc(50% - 240px));
}
.tl-story-viewer__nav--next {
    right: max(12px, calc(50% - 240px));
}
@media (max-width: 520px) {
    .tl-story-viewer__nav {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    .tl-story-viewer__nav--prev { left: 6px; }
    .tl-story-viewer__nav--next { right: 6px; }
}

/* Add story modal */
.tl-story-add {
    position: fixed;
    inset: 0;
    z-index: 12100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-story-add[hidden] {
    display: none !important;
}
.tl-story-add__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}
.tl-story-add__card {
    position: relative;
    z-index: 2;
    width: min(360px, 92vw);
    background: var(--bg-elev-2, #1a1a22);
    border: 1px solid var(--line, #2a2a35);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.tl-story-add__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 1.1rem;
    cursor: pointer;
}
.tl-story-add__title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 700;
}
.tl-story-add__choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tl-story-add__choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    border-radius: 12px;
    border: 1px solid var(--line, #2a2a35);
    background: var(--bg-elev-3, #25252b);
    color: var(--text, #e8e8e8);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color 0.15s;
}
.tl-story-add__choice i {
    font-size: 1.5rem;
    color: #1e56f5;
}
.tl-story-add__choice:hover {
    border-color: #1e56f5;
}
.tl-story-add__preview-box {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 50vh;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 14px;
}
.tl-story-add__img,
.tl-story-add__vid {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tl-story-add__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.tl-story-add__btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
}
.tl-story-add__btn--ghost {
    background: transparent;
    color: var(--text-muted, #9ca3af);
    border: 1px solid var(--line, #2a2a35);
}
.tl-story-add__btn--primary {
    background: #1e56f5;
    color: #fff;
}
.tl-story-add__btn--record {
    background: #dc2626;
    color: #fff;
}
.tl-story-add__btn--record.is-recording {
    animation: tlStoryRecPulse 1s ease infinite;
}
@keyframes tlStoryRecPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}
.tl-story-add__record-timer {
    margin: 8px 0 0;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #f87171;
}
.tl-story-add__msg {
    margin: 12px 0 0;
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.4;
}
.tl-story-add__msg.is-error {
    color: #f87171;
}
.tl-story-add__msg.is-ok {
    color: #4ade80;
}
.tl-story-add__camera-wrap {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 50vh;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 12px;
}
.tl-story-add__camera-vid {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
}
.tl-story-add__camera-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Glass UI */
.tl-story-viewer__phone,
.tl-story-add__card,
.tl-story-comments__panel,
.tl-story-viewers-menu__panel,
.tl-story-editor__shell {
    background: rgba(18, 20, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px) saturate(165%);
    -webkit-backdrop-filter: blur(20px) saturate(165%);
}
.tl-story-add__card {
    background: rgba(22, 24, 32, 0.72);
}

.tl-story-viewer__actions {
    position: absolute;
    right: 12px;
    bottom: 16px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tl-story-viewer__act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    width: 48px;
    min-height: 48px;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(8px);
}
.tl-story-viewer__act span {
    font-size: 0.62rem;
    font-weight: 700;
}
.tl-story-viewer__act.is-liked {
    color: #f43f5e;
}

.tl-story-viewer__viewers {
    position: absolute;
    left: 12px;
    bottom: 16px;
    z-index: 5;
}
.tl-story-viewer__viewers-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.tl-story-viewer__viewer-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    margin-inline-start: -8px;
}
.tl-story-viewer__viewer-av:first-child {
    margin-inline-start: 0;
}

.tl-story-comments,
.tl-story-viewers-menu,
.tl-story-editor {
    position: fixed;
    inset: 0;
    z-index: 12200;
}
.tl-story-editor {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.tl-story-viewer__phone > .tl-story-comments,
.tl-story-viewer__phone > .tl-story-viewers-menu {
    position: absolute;
    inset: 0;
    z-index: 12;
}
.tl-story-comments[hidden],
.tl-story-viewers-menu[hidden],
.tl-story-editor[hidden] {
    display: none !important;
}
.tl-story-comments__backdrop,
.tl-story-viewers-menu__backdrop,
.tl-story-editor__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.tl-story-comments__panel,
.tl-story-viewers-menu__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tl-story-viewer__phone > .tl-story-comments .tl-story-comments__panel,
.tl-story-viewer__phone > .tl-story-viewers-menu .tl-story-viewers-menu__panel {
    max-height: 58%;
    border-radius: 14px 14px 0 0;
}
.tl-story-viewer__phone > .tl-story-comments .tl-story-comments__backdrop,
.tl-story-viewer__phone > .tl-story-viewers-menu .tl-story-viewers-menu__backdrop {
    background: rgba(0, 0, 0, 0.42);
}
.tl-story-comments__head,
.tl-story-viewers-menu__head,
.tl-story-editor__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tl-story-comments__head h4,
.tl-story-viewers-menu__head h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.tl-story-comments__close,
.tl-story-viewers-menu__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.tl-story-comments__close:hover,
.tl-story-viewers-menu__close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.tl-story-comments__list,
.tl-story-viewers-menu__list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.tl-story-comments__item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.tl-story-comments__av {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.tl-story-comments__body p {
    margin: 4px 0 0;
    font-size: 0.86rem;
    word-break: break-word;
}
.tl-story-comments__meta {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 0.72rem;
}
.tl-story-comments__reply,
.tl-story-comments__del {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 0;
}
.tl-story-comments__form {
    display: flex;
    gap: 8px;
    padding: 10px 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tl-story-comments__login-hint {
    margin: 0;
    padding: 10px 16px 14px;
    font-size: 0.82rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tl-story-comments__form input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    padding: 8px 14px;
}
.tl-story-comments__send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1e56f5;
    color: #fff;
    cursor: pointer;
}
.tl-story-viewers-menu__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: inherit;
    text-decoration: none;
}
.tl-story-viewers-menu__row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.tl-story-viewers-menu__anon {
    padding: 0 16px 14px;
    font-size: 0.78rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
}

.tl-story-editor__shell {
    position: relative;
    z-index: 2;
    width: min(380px, 92vw);
    margin: auto;
    border-radius: 16px;
    overflow: visible;
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.tl-story-editor__stage-wrap {
    padding: 0;
}
.tl-story-editor__stage {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: min(680px, 88vh);
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    touch-action: none;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}
.tl-story-editor__overlay-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 4;
    pointer-events: none;
}
.tl-story-editor__overlay-top > * {
    pointer-events: auto;
}
.tl-story-editor__overlay-tools {
    position: absolute;
    top: 58px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 4;
    max-height: calc(100% - 120px);
    overflow-y: auto;
    scrollbar-width: none;
}
.tl-story-editor__overlay-tools::-webkit-scrollbar {
    display: none;
}
.tl-story-editor__overlay-btn,
.tl-story-editor__tool {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.tl-story-editor__overlay-btn--primary {
    background: rgba(30, 86, 245, 0.88);
    border-color: rgba(30, 86, 245, 0.95);
}
.tl-story-editor__tool.is-active {
    background: rgba(30, 86, 245, 0.82);
    border-color: rgba(96, 165, 250, 0.95);
}
.tl-story-editor__compose[hidden],
.tl-story-editor__emoji-picker[hidden],
.tl-story-editor__trash[hidden],
.tl-story-editor__style-panel[hidden] {
    display: none !important;
}
.tl-story-editor__layer.is-selected {
    outline: 2px dashed rgba(96, 165, 250, 0.95);
    outline-offset: 4px;
}
.tl-story-editor__style-panel {
    position: absolute;
    left: 10px;
    right: 54px;
    top: 108px;
    z-index: 6;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-height: min(42vh, 240px);
    overflow-y: auto;
}
.tl-story-editor__style-group {
    margin-bottom: 10px;
}
.tl-story-editor__style-group:last-child {
    margin-bottom: 0;
}
.tl-story-editor__style-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tl-story-editor__style-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tl-story-editor__swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.tl-story-editor__swatch.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(30, 86, 245, 0.9);
}
.tl-story-editor__swatch--bg.is-none {
    background: transparent;
    color: #fff;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tl-story-editor__style-sizes {
    display: flex;
    gap: 8px;
}
.tl-story-editor__size-btn {
    min-width: 40px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.tl-story-editor__size-btn.is-active {
    background: rgba(30, 86, 245, 0.85);
    border-color: rgba(96, 165, 250, 0.95);
}
.tl-story-editor__emoji-pack-head {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    padding: 6px 4px 4px;
    margin-top: 4px;
}
.tl-story-editor__emoji-pack-head:first-child {
    margin-top: 0;
}
.tl-story-editor__emoji-pack-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.tl-story-editor__picker-empty {
    margin: 0;
    padding: 12px 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}
.tl-story-editor__compose {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 18%;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tl-story-editor__compose-input {
    flex: 1 1 120px;
    min-width: 0;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.86rem;
}
.tl-story-editor__compose-ok {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #1e56f5;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.tl-story-editor__layer {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: grab;
    user-select: none;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
    max-width: 88%;
    word-break: break-word;
    touch-action: none;
}
.tl-story-editor__layer.is-dragging {
    cursor: grabbing;
    z-index: 6;
}
.tl-story-editor__layer img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    pointer-events: none;
}
.tl-story-editor__trash {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 7;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.tl-story-editor__trash.is-hot {
    background: rgba(220, 38, 38, 0.88);
    border-color: rgba(254, 202, 202, 0.9);
    transform: translateX(-50%) scale(1.08);
}
.tl-story-editor__tools {
    display: none;
}
.tl-story-editor__tool,
.tl-story-editor__btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}
.tl-story-editor__btn--primary {
    background: #1e56f5;
    border-color: #1e56f5;
}
.tl-story-editor__emoji-picker {
    position: absolute;
    left: 10px;
    right: 54px;
    top: 108px;
    bottom: auto;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 8px;
    max-height: min(38vh, 220px);
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tl-story-editor__emoji-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
}
.tl-story-editor__emoji-btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
