/* Soft UI — light neumorphic card theme. Everything is scoped under body.sui;
   removing that class restores the original template look. */

/* === TOKENS === */
.sui {
    --sui-bg: #F4F4F2;
    --sui-bg-deep: #ECECEA;
    --sui-bg-glass: rgba(244, 244, 242, 0.86);
    --sui-surface: #FCFCFA;
    --sui-surface-glass: rgba(252, 252, 250, 0.92);
    --sui-well-top: #EBEBE8;
    --sui-well-bottom: #F6F5F1;
    --sui-pressed: #E8E8E5;
    --sui-text: #181816;
    --sui-text-2: #6E6E68;
    --sui-icon: #31312F;
    --sui-accent: #F5BA30;
    --sui-accent-ink: #D99A1E;
    --sui-accent-soft: #FFF5E7;
    --sui-on-accent: #7B4400;
    --sui-badge-bg: #FFEEC1;
    --sui-badge-ink: #76530F;

    --sui-shadow: 0 6px 14px rgba(26, 26, 20, 0.07), 0 1px 3px rgba(26, 26, 20, 0.05), -4px -4px 12px rgba(255, 255, 255, 0.85);
    --sui-shadow-sm: 0 3px 8px rgba(26, 26, 20, 0.08), -2px -2px 6px rgba(255, 255, 255, 0.9);
    --sui-shadow-float: 0 12px 30px rgba(26, 26, 20, 0.10), 0 2px 6px rgba(26, 26, 20, 0.05);
    --sui-shadow-pressed: inset 3px 3px 7px rgba(26, 26, 20, 0.09), inset -3px -3px 7px rgba(255, 255, 255, 0.9);
    --sui-well-shadow: inset 2px 2px 5px rgba(26, 26, 20, 0.06), inset -2px -2px 5px rgba(255, 255, 255, 0.8);

    --sui-r-xl: 24px;
    --sui-r-lg: 20px;
    --sui-r-md: 16px;
    --sui-ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

[data-theme="dark"] .sui {
    --sui-bg: #17181B;
    --sui-bg-deep: #121316;
    --sui-bg-glass: rgba(23, 24, 27, 0.86);
    --sui-surface: #202227;
    --sui-surface-glass: rgba(32, 34, 39, 0.92);
    --sui-well-top: #1A1B1F;
    --sui-well-bottom: #25272C;
    --sui-pressed: #16171A;
    --sui-text: #F1F1EE;
    --sui-text-2: #A3A39C;
    --sui-icon: #E4E4E0;
    --sui-accent-ink: #F2B53A;
    --sui-accent-soft: rgba(245, 186, 48, 0.12);
    --sui-on-accent: #3D2400;
    --sui-badge-bg: rgba(245, 186, 48, 0.16);
    --sui-badge-ink: #F5C451;

    --sui-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), -3px -3px 10px rgba(255, 255, 255, 0.025);
    --sui-shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.35);
    --sui-shadow-float: 0 12px 30px rgba(0, 0, 0, 0.45);
    --sui-shadow-pressed: inset 3px 3px 8px rgba(0, 0, 0, 0.45), inset -2px -2px 6px rgba(255, 255, 255, 0.03);
    --sui-well-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.4), inset -2px -2px 6px rgba(255, 255, 255, 0.03);
}

body.sui {
    background-color: var(--sui-bg);
    color: var(--sui-text);
}

/* === HEADER === */
.sui header.default.heade-sticky {
    min-height: 68px;
    padding: 10px 16px 6px;
    background: var(--sui-bg-glass);
    -webkit-backdrop-filter: saturate(1.2) blur(14px);
    backdrop-filter: saturate(1.2) blur(14px);
}

.sui .space-sticky {
    height: 68px;
}

.sui header.default .nav-text {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--sui-text);
}

/* Flex drops the whitespace between the per-letter spans */
.sui header.default .nav-text .text-container {
    display: inline-flex;
}

.sui header.default .nav-text .letter {
    margin-right: 0;
}

.sui header.default .un-title-page h6 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--sui-text);
}

.sui header.default .un-title-page.go-back .icon {
    width: 40px;
    height: 40px;
    margin-left: 12px;
    font-size: 26px;
    color: var(--sui-icon);
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow-sm);
}

.sui header.default .un-block-right {
    column-gap: 12px;
}

.sui header.default .un-block-right .un-user-profile a .img-avatar {
    width: 44px;
    height: 44px;
    border: 3px solid var(--sui-surface);
    box-shadow: var(--sui-shadow-sm);
}

.sui header.default .un-block-right .menu-sidebar .btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--sui-icon);
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow-sm);
    transition: box-shadow 0.2s ease;
}

.sui header.default .un-block-right .menu-sidebar .btn:active {
    box-shadow: var(--sui-shadow-pressed);
}

.sui header.default .un-block-right .menu-sidebar .btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* === BOTTOM NAVIGATION === */
.sui .un-bottom-navigation {
    padding-top: 104px;
}

.sui .un-bottom-navigation.filter-blur .em_body_navigation {
    left: 14px;
    right: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    min-height: 70px;
    padding: 7px;
    gap: 4px;
    border: 0;
    border-radius: 30px;
    background: var(--sui-surface-glass);
    -webkit-backdrop-filter: saturate(1.2) blur(18px);
    backdrop-filter: saturate(1.2) blur(18px);
    box-shadow: var(--sui-shadow-float);
}

.sui .un-bottom-navigation .em_body_navigation .item_link {
    flex: 1 1 0;
    height: auto;
}

.sui .un-bottom-navigation .em_body_navigation .item_link .btn_navLink {
    position: relative;
    width: 100%;
    max-width: 96px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 24px;
    font-family: inherit;
    color: var(--sui-icon);
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.sui .un-bottom-navigation .em_body_navigation .item_link .btn_navLink::after {
    display: none;
}

.sui .un-bottom-navigation .em_body_navigation .item_link .btn_navLink i,
.sui .un-bottom-navigation .em_body_navigation .item_link .btn_navLink.active .icon_active i {
    font-size: 22px;
    line-height: 1;
    color: var(--sui-icon);
}

.sui .un-bottom-navigation .em_body_navigation .item_link .btn_navLink.active {
    background-color: var(--sui-pressed);
    box-shadow: var(--sui-shadow-pressed);
}

.sui .sui-nav-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: var(--sui-text-2);
}

.sui .btn_navLink.active .sui-nav-label {
    color: var(--sui-text);
}

.sui .sui-nav-soon {
    position: absolute;
    top: 1px;
    inset-inline-end: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--sui-on-accent);
    background: var(--sui-accent);
    pointer-events: none;
}

/* === PAGE TRANSITIONS (ngAnimate on ng-view only) === */
.sui .sui-view-stage {
    position: relative;
    overflow-x: clip;
}

@supports not (overflow-x: clip) {
    .sui .sui-view-stage {
        overflow-x: hidden;
    }
}

.sui .sui-view-stage.is-forward > .sui-view.ng-enter,
.sui .sui-view-stage.is-forward > .sui-view.ng-leave,
.sui .sui-view-stage.is-back > .sui-view.ng-enter,
.sui .sui-view-stage.is-back > .sui-view.ng-leave {
    transition: transform 0.38s var(--sui-ease), opacity 0.38s var(--sui-ease);
    background-color: var(--sui-bg);
    will-change: transform;
}

.sui .sui-view-stage > .sui-view.ng-enter {
    position: relative;
}

.sui .sui-view-stage > .sui-view.ng-leave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* RTL push: the new page arrives from the left, the old one drifts right */
.sui .sui-view-stage.is-forward > .sui-view.ng-enter {
    z-index: 2;
    transform: translate3d(-100%, 0, 0);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.08);
}

.sui .sui-view-stage.is-forward > .sui-view.ng-enter.ng-enter-active {
    transform: translate3d(0, 0, 0);
}

.sui .sui-view-stage.is-forward > .sui-view.ng-leave {
    z-index: 1;
}

.sui .sui-view-stage.is-forward > .sui-view.ng-leave.ng-leave-active {
    transform: translate3d(28%, 0, 0);
    opacity: 0.5;
}

/* RTL pop: the current page leaves to the left, the previous one returns from the right */
.sui .sui-view-stage.is-back > .sui-view.ng-leave {
    z-index: 2;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.08);
}

.sui .sui-view-stage.is-back > .sui-view.ng-leave.ng-leave-active {
    transform: translate3d(-100%, 0, 0);
}

.sui .sui-view-stage.is-back > .sui-view.ng-enter {
    z-index: 1;
    transform: translate3d(28%, 0, 0);
    opacity: 0.5;
}

.sui .sui-view-stage.is-back > .sui-view.ng-enter.ng-enter-active {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .sui .sui-view-stage > .sui-view.ng-enter,
    .sui .sui-view-stage > .sui-view.ng-leave {
        transition: none !important;
    }
}

/* === SHARED COMPONENTS === */
.sui .sui-section {
    margin-top: 26px;
}

.sui .sui-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    margin-bottom: 4px;
}

.sui .sui-section-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--sui-text);
}

.sui .sui-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    color: var(--sui-icon);
    text-decoration: none;
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow-sm);
    transition: box-shadow 0.2s ease;
}

.sui .sui-icon-btn:active {
    box-shadow: var(--sui-shadow-pressed);
}

/* === HOME: STORIES ROW === */
.sui .sui-stories {
    margin: 4px 0 6px;
}

.sui .sui-stories .swiper {
    padding: 8px 0 4px;
}

/* Zuck stories also carry .swiper-slide, so the cover-slide aspect ratio would stretch them */
.sui .wrapper-stories .story {
    width: 72px !important;
    height: auto !important;
    aspect-ratio: auto;
    margin-left: 14px !important;
    font-size: 12.5px;
    line-height: 1.4;
}

.sui .wrapper-stories .story:first-child {
    margin-right: 16px;
}

.sui .wrapper-stories .story > .item-link {
    width: 72px;
    color: var(--sui-text);
    text-decoration: none;
}

.sui .wrapper-stories .story > .item-link > .item-preview {
    width: 68px !important;
    height: 68px !important;
    margin: 0 auto;
    border-radius: 22px;
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow);
}

.sui .wrapper-stories .story > .item-link > .item-preview::before {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--sui-accent-soft);
    box-shadow: 0 0 0 2px var(--sui-accent);
}

.sui .wrapper-stories .story > .item-link > .item-preview img {
    position: relative;
    z-index: 1;
    width: 44px !important;
    height: 44px !important;
    border: 0 !important;
    border-radius: 50%;
}

.sui .wrapper-stories .story.seen .item-link .item-preview::before,
.sui .wrapper-stories .story > .item-link.visited .item-preview::before {
    background: var(--sui-bg-deep);
    box-shadow: 0 0 0 2px var(--sui-pressed);
}

.sui .wrapper-stories .story > .item-link > .info {
    display: block;
    margin-top: 8px !important;
}

.sui .wrapper-stories .story > .item-link > .info .name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--sui-text);
}

/* === HOME: TOOLS GRID === */
.sui .tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 460px;
    padding: 6px 14px 4px;
}

.sui .tool-card {
    min-height: 118px;
    aspect-ratio: auto;
    padding: 16px 4px 14px;
    gap: 11px;
    border-radius: var(--sui-r-xl);
    color: var(--sui-text);
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow);
    transform-style: flat;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sui .tool-card:active {
    transform: scale(0.97);
    box-shadow: var(--sui-shadow-pressed);
}

.sui .tool-card .tool-icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 17px;
    font-size: 26px;
    line-height: 1;
    color: var(--sui-accent-ink);
    background: linear-gradient(180deg, var(--sui-well-top), var(--sui-well-bottom));
    box-shadow: var(--sui-well-shadow);
}

.sui .tool-card .tool-icon svg {
    width: 26px;
    height: 26px;
}

.sui .tool-card .tool-name {
    margin: 0;
    font-size: clamp(11px, 3.15vw, 12.5px);
    font-weight: 700;
    line-height: 1.35;
    color: var(--sui-text);
}

.sui .tool-card.pro::after {
    content: 'PRO';
    top: 10px;
    right: 10px;
    left: auto;
    transform: none;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.2;
    color: var(--sui-badge-ink);
    background: var(--sui-badge-bg);
    -webkit-background-clip: border-box;
    background-clip: border-box;
    text-shadow: none;
    animation: none;
}

.sui .tool-soon-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--sui-accent);
    color: #7B4400;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
}

.sui .tool-card.soon {
    grid-column: 1 / -1;
    min-height: 74px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 14px;
    background-color: var(--sui-surface);
    color: var(--sui-text);
}

.sui .tool-card.soon .tool-icon {
    width: 48px;
    height: 48px;
    font-size: 23px;
    border-radius: 15px;
    color: var(--sui-accent-ink);
}

.sui .tool-card.soon .tool-name {
    font-size: 14px;
}

.sui .tool-card.soon .tool-badge {
    position: static;
    order: 3;
    margin-inline-start: auto;
    padding: 6px 15px;
    font-size: 12px;
    font-weight: 800;
    color: var(--sui-on-accent);
    background: var(--sui-accent);
    box-shadow: none;
}

/* === HOME: COVER SLIDERS === */
.sui .sui-section .swiper {
    padding: 10px 16px 20px;
}

.sui .sui-section .swiper-slide.story,
.sui .sui-section .swiper-slide.post {
    width: 132px;
    max-width: none;
    padding: 6px;
    border-radius: 22px;
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow);
}

.sui .sui-section .swiper-slide.story {
    aspect-ratio: 9 / 16;
}

.sui .sui-section .swiper-slide.post {
    aspect-ratio: 1 / 1;
}

.sui .sui-section .swiper-slide > a {
    display: block;
    width: 100%;
    height: 100%;
}

.sui .sui-section .swiper-slide img {
    border-radius: 17px;
}

/* === COVER GALLERY (reels.html) === */
.sui .sui-page-reels {
    padding: 6px 16px 0;
}

.sui .sui-segmented {
    width: 100%;
    gap: 6px;
    padding: 6px;
    border-radius: 22px;
    background-color: var(--sui-bg-deep);
    box-shadow: var(--sui-shadow-pressed);
}

.sui .sui-segmented .nav-item .nav-link {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--sui-text-2);
    background-color: transparent;
}

.sui .sui-segmented .nav-item .nav-link.active {
    color: var(--sui-text);
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow-sm);
}

.sui .sui-page-reels .image-grid {
    gap: 12px;
    padding: 16px 0 0;
}

.sui .sui-page-reels .grid-item {
    padding: 5px;
    border-radius: 18px;
    background-color: var(--sui-surface);
    box-shadow: var(--sui-shadow);
}

.sui .sui-page-reels .grid-item a {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 13px;
    background-color: var(--sui-bg-deep);
}

/* Tools hosted inside the shell (analyze, story font, music) */
.sui .sui-embed {
    height: calc(100dvh - 68px - 108px);
    min-height: 420px;
    margin: 0;
    background: var(--sui-bg);
}

.sui .sui-embed-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--sui-bg);
}
