@charset "UTF-8";

    .sp-page {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .sp-card {
        background: var(--card-bg);
        border-radius: 16px;
        box-shadow: var(--card-shadow);
        padding: 20px;
    }

    .sp-page .section-header {
        margin-bottom: -6px;
    }

    /* Гість — одна картка з поясненням, як порожній стан сайту. */
    .sp-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 32px 20px;
    }

    .sp-hero-icon,
    .sp-head-icon,
    .sp-row-icon,
    .sp-cat-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: #fff;
    }

    .sp-hero-icon {
        width: 64px;
        height: 64px;
        border-radius: 20px;
        background: var(--accent-color);
    }

    .sp-hero-icon svg,
    .sp-hero-icon i[data-lucide] {
        width: 30px;
        height: 30px;
    }

    .sp-hero-title {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-primary);
    }

    .sp-hero-text {
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-secondary);
        max-width: 420px;
    }

    .sp-btn {
        width: 100%;
        padding: 15px;
        border: none;
        border-radius: 14px;
        background: var(--accent-color);
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        cursor: pointer;
        text-decoration: none;
    }

    .sp-btn:hover {
        background: #7233E8;
    }

    .sp-btn svg,
    .sp-btn i[data-lucide] {
        width: 20px;
        height: 20px;
    }

    .sp-hero .sp-btn {
        margin-top: 8px;
        max-width: 320px;
    }

    /* Звернення згори: значок розділу, тема, стан. */
    .sp-head {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px;
    }

    .sp-head-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .sp-head-icon svg,
    .sp-head-icon i[data-lucide],
    .sp-row-icon svg,
    .sp-row-icon i[data-lucide] {
        width: 20px;
        height: 20px;
    }

    .sp-head-body {
        min-width: 0;
        flex: 1;
    }

    .sp-head-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-primary);
        overflow-wrap: anywhere;
    }

    .sp-head-meta {
        font-size: 13px;
        color: var(--text-secondary);
        margin-top: 2px;
    }

    /* Розмова: свої — праворуч фіолетовим відтінком, підтримка — ліворуч. */
    .sp-thread {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sp-msg {
        max-width: 86%;
        padding: 12px 14px;
        border-radius: 16px;
        background: var(--card-bg);
        box-shadow: var(--card-shadow);
    }

    .sp-msg.is-mine {
        align-self: flex-end;
        background: rgba(136, 73, 254, .10);
        box-shadow: none;
        border-bottom-right-radius: 6px;
    }

    .sp-msg.is-staff {
        align-self: flex-start;
        border-bottom-left-radius: 6px;
    }

    .sp-msg-who {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-tertiary);
        margin-bottom: 4px;
    }

    .sp-msg.is-staff .sp-msg-who {
        color: var(--accent-color);
    }

    .sp-msg-text {
        font-size: 15px;
        line-height: 1.45;
        color: var(--text-primary);
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }

    /* Форма — як «Створити кімнату». */
    .sp-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .sp-form-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-tertiary);
        text-transform: uppercase;
        letter-spacing: .5px;
    }

    .sp-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .sp-label {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .sp-req {
        color: #EF4444;
        margin-left: 2px;
    }

    .sp-input,
    .sp-textarea {
        width: 100%;
        padding: 14px 16px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        font-size: 15px;
        font-family: inherit;
        color: var(--text-primary);
        background: var(--bg-primary);
        transition: border-color .2s;
        box-sizing: border-box;
    }

    .sp-textarea {
        min-height: 120px;
        resize: vertical;
    }

    .sp-input:focus,
    .sp-textarea:focus {
        outline: none;
        border-color: var(--accent-color);
    }

    .sp-input::placeholder,
    .sp-textarea::placeholder {
        color: var(--text-tertiary);
    }

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

    .sp-cat {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        background: var(--bg-primary);
        border: 2px solid var(--border-color);
        border-radius: 14px;
        cursor: pointer;
        min-width: 0;
        transition: border-color .2s, background .2s;
    }

    .sp-cat input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .sp-cat:has(input:checked) {
        border-color: var(--accent-color);
        background: rgba(136, 73, 254, .08);
    }

    .sp-cat-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .sp-cat-icon svg,
    .sp-cat-icon i[data-lucide] {
        width: 16px;
        height: 16px;
    }

    .sp-cat-name {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.25;
    }

    /* Значок розділу в рядку списку — як .settings-icon-wrap, але кольором розділу. */
    .sp-row-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .sp-clip {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sp-dot {
        flex-shrink: 0;
        padding: 3px 8px;
        border-radius: 8px;
        background: var(--accent-color);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
    }

    .sp-close {
        display: flex;
        justify-content: center;
    }

    .sp-link {
        border: none;
        background: none;
        color: var(--text-secondary);
        font: inherit;
        font-size: 14px;
        text-decoration: underline;
        cursor: pointer;
        padding: 4px;
    }

    .sp-note {
        font-size: 14px;
        color: var(--text-secondary);
        line-height: 1.5;
    }

    .sp-note a {
        color: var(--accent-color);
        font-weight: 600;
        margin-left: 4px;
    }

    .sp-ban {
        display: flex;
        gap: 12px;
        background: rgba(239, 68, 68, .10);
        box-shadow: none;
        color: #DC2626;
    }

    .sp-ban > svg,
    .sp-ban > i[data-lucide] {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .sp-ban-title {
        font-weight: 700;
        font-size: 15px;
        line-height: 1.4;
    }

    .sp-ban-text {
        margin-top: 4px;
        font-size: 14px;
        line-height: 1.45;
        color: var(--text-secondary);
    }


    .app-toasts {
        position: fixed;
        left: 50%;
        bottom: 12px;
        z-index: 10050;
        width: calc(100% - 24px);
        max-width: 440px;
        height: 0;
        transform: translateX(-50%);
        pointer-events: none;
    }

    /* Плоска заливка одним кольором — без градієнта, глянцю й кольорового
       світіння. */
    .app-toast {
        --t-bg: #7C3AED;
        --t-fg: #FFFFFF;
        --t-glass: rgba(255, 255, 255, .2);
        --t-glass-hover: rgba(255, 255, 255, .3);
        --t-edge: rgba(255, 255, 255, .38);
        --t-line: rgba(255, 255, 255, .45);
        --y: 0px;
        --s: 1;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 54px;
        padding: 8px 8px 8px 16px;
        overflow: hidden;
        border-radius: 16px;
        background: var(--t-bg);
        color: var(--t-fg);
        font-size: 14.5px;
        line-height: 1.35;
        box-shadow: 0 8px 24px rgba(17, 24, 39, .18);
        transform: translate3d(0, var(--y), 0) scale(var(--s));
        transform-origin: 50% 100%;
        transition: transform .5s cubic-bezier(.18, 1.2, .4, 1), translate .3s ease, opacity .3s ease, height .3s ease;
        pointer-events: auto;
        touch-action: pan-y;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Кольори — трохи темніші й насиченіші (власник того ж вечора). */
    .app-toast.is-success {
        --t-bg: #039855;
    }

    .app-toast.is-error {
        --t-bg: #D92D20;
    }

    /* Жовта — з темним текстом: білий на жовтому не читається. */
    .app-toast.is-warning {
        --t-bg: #F79009;
        --t-fg: #2B1700;
        --t-glass: rgba(255, 255, 255, .38);
        --t-glass-hover: rgba(255, 255, 255, .55);
        --t-edge: rgba(255, 255, 255, .6);
        --t-line: rgba(59, 35, 0, .3);
    }

    body.dark .app-toast {
        box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
    }

    /* Появи: знизу з пружинкою. Відхід: униз і тане. */
    .app-toast.is-in {
        --y: 26px !important;
        --s: .9 !important;
        opacity: 0 !important;
        transition: none;
    }

    .app-toast.is-out {
        opacity: 0 !important;
        transition: transform .3s ease, translate .3s ease, opacity .25s ease;
        pointer-events: none;
    }

    .app-toast.is-out:not(.is-swiped) {
        --y: 14px !important;
        --s: .94 !important;
    }

    .app-toast.is-dragging {
        transition: none;
    }

    /* Те саме вдруге — не ще одна картка, а легкий поштовх старої. */
    .app-toast.is-bump {
        animation: at-bump .35s ease;
    }

    @keyframes at-bump {
        40% {
            scale: 1.03;
        }
    }

    .app-toast > * {
        position: relative;
        transition: opacity .2s ease;
    }

    /* Задні в стосі: висота передньої, вміст прихований. */
    .app-toast.is-back > * {
        opacity: 0;
    }

    /* ---- текст */
    .at-body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
        padding: 4px 0;
    }

    .at-title {
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    .at-text {
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .at-title + .at-text {
        font-size: 13.5px;
        font-weight: 500;
        opacity: .92;
    }

    /* ---- скло: хрестик і кнопка дії */
    .at-x,
    .at-act {
        flex: 0 0 auto;
        border: 1px solid var(--t-edge);
        background: var(--t-glass);
        color: inherit;
        -webkit-backdrop-filter: blur(10px) saturate(160%);
        backdrop-filter: blur(10px) saturate(160%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .06);
        cursor: pointer;
        transition: background-color .15s ease, transform .15s ease;
    }

    .at-x:hover,
    .at-act:hover {
        background: var(--t-glass-hover);
    }

    .at-x:active,
    .at-act:active {
        transform: scale(.93);
    }

    .at-x {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 50%;
    }

    .at-x svg {
        width: 14px;
        height: 14px;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.6;
        stroke-linecap: round;
    }

    .at-act {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        height: 36px;
        padding: 0 10px 0 14px;
        border-radius: 12px;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
    }

    .app-toast button:focus {
        outline: none;
    }

    .app-toast button:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 1px;
    }

    /* ---- зворотний відлік кільцем — усередині кнопки «Скасувати» */
    .at-count {
        position: relative;
        flex: 0 0 auto;
        width: 22px;
        height: 22px;
    }

    .at-count svg {
        position: absolute;
        inset: 0;
        width: 22px;
        height: 22px;
        transform: rotate(-90deg);
        fill: none;
        stroke-width: 2.4;
    }

    .at-count .at-track {
        stroke: var(--t-line);
    }

    .at-count .at-arc {
        stroke: currentColor;
        stroke-linecap: round;
        stroke-dasharray: 56.55;
        stroke-dashoffset: 0;
        animation: at-arc linear forwards;
        animation-duration: var(--t-dur, 10s);
    }

    @keyframes at-arc {
        to {
            stroke-dashoffset: 56.55;
        }
    }

    .at-count b {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
    }

    .at-count b.is-tick {
        animation: at-tick .3s ease;
    }

    @keyframes at-tick {
        from {
            transform: translateY(-4px);
            opacity: 0;
        }
    }

    /* ---- скільки лишилося */
    .at-time {
        position: absolute !important;
        left: 0;
        right: 0;
        bottom: 0;
        height: 3px;
        background: var(--t-line);
        transform-origin: 0 50%;
        animation: at-time linear forwards;
        animation-duration: var(--t-dur, 3s);
    }

    @keyframes at-time {
        to {
            transform: scaleX(0);
        }
    }

    .app-toasts.is-paused .at-time,
    .app-toasts.is-paused .at-arc {
        animation-play-state: paused;
    }

    @media (prefers-reduced-motion: reduce) {
        .app-toast {
            transition: opacity .2s ease;
        }

        .at-count b.is-tick {
            animation: none !important;
        }
    }


    /* Рідне «потягніть» браузера — геть: тягнемо самі. */
    @media (pointer: coarse) {
        html,
        body {
            overscroll-behavior-y: none;
        }
    }

    /* Кружечок за шапку — скляний, як кнопки сайту. */
    .ptr-dot {
        position: fixed;
        left: 50%;
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        z-index: 2000;
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .72);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 1px 1px rgba(255, 255, 255, .8), 0 4px 16px rgba(17, 24, 39, .16);
        -webkit-backdrop-filter: blur(14px) saturate(180%);
        backdrop-filter: blur(14px) saturate(180%);
        color: var(--text-secondary, #6B7280);
        opacity: 0;
        transform: translate(-50%, -52px);
        pointer-events: none;
    }

    body.dark .ptr-dot {
        background: rgba(38, 38, 42, .66);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 1px rgba(255, 255, 255, .2), 0 4px 16px rgba(0, 0, 0, .4);
    }

    .ptr-dot svg {
        width: 19px;
        height: 19px;
    }

    .ptr-dot.is-back {
        transition: transform .3s cubic-bezier(.22, 1, .36, 1), opacity .2s;
    }

    .ptr-dot.is-ready {
        color: var(--accent-color, #8849FE);
    }

    .ptr-dot.is-spin svg {
        animation: ptr-spin .5s linear infinite;
    }

    /* Щілина над колонкою: кільце-поступ, стрілка, підпис. */
    .ptr-list {
        position: fixed;
        z-index: 90;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        color: var(--text-secondary, #6B7280);
        font-size: 12px;
        font-weight: 500;
    }

    .ptr-list.is-settle,
    .content.ptr-settle {
        transition: transform .45s cubic-bezier(.22, 1, .36, 1), height .45s cubic-bezier(.22, 1, .36, 1), opacity .3s;
    }

    .content.ptr-pulling {
        will-change: transform;
    }

    .ptr-ring {
        position: relative;
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
    }

    .ptr-svg {
        position: absolute;
        inset: 0;
        width: 30px;
        height: 30px;
        transform: rotate(-90deg);
    }

    .ptr-trk {
        fill: none;
        stroke: var(--border-color, #E5E7EB);
        stroke-width: 2.5;
    }

    .ptr-arc {
        fill: none;
        stroke: var(--text-secondary, #9CA3AF);
        stroke-width: 2.5;
        stroke-linecap: round;
        stroke-dasharray: 75.4;
        stroke-dashoffset: 75.4;
        transition: stroke .2s;
    }

    .ptr-list.is-ready {
        color: var(--accent-color, #8849FE);
    }

    .ptr-list.is-ready .ptr-arc {
        stroke: var(--accent-color, #8849FE);
    }

    .ptr-list.is-loading .ptr-arc {
        stroke: var(--accent-color, #8849FE);
        stroke-dashoffset: 50 !important;
    }

    .ptr-list.is-loading .ptr-trk {
        stroke: transparent;
    }

    .ptr-list.is-loading .ptr-svg {
        animation: ptr-ring-spin .5s linear infinite;
    }

    /* Список, що чекає (не з тих, де рядки самі стають скелетоном), — притихає. */
    .ptr-wait {
        opacity: .45;
        transition: opacity .2s;
    }

    /* Свіжі рядки підтягуються один за одним. */
    .ptr-fresh > * {
        animation: ptr-in .3s ease-out both;
    }

    .ptr-fresh > :nth-child(2) { animation-delay: .03s; }
    .ptr-fresh > :nth-child(3) { animation-delay: .06s; }
    .ptr-fresh > :nth-child(4) { animation-delay: .09s; }
    .ptr-fresh > :nth-child(5) { animation-delay: .12s; }
    .ptr-fresh > :nth-child(6) { animation-delay: .15s; }
    .ptr-fresh > :nth-child(7) { animation-delay: .18s; }
    .ptr-fresh > :nth-child(n+8) { animation-delay: .21s; }

    @keyframes ptr-in {
        from {
            opacity: 0;
            transform: translateY(6px);
        }
    }

    @keyframes ptr-spin {
        to {
            transform: rotate(360deg);
        }
    }

    @keyframes ptr-ring-spin {
        from {
            transform: rotate(-90deg);
        }

        to {
            transform: rotate(270deg);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .ptr-list.is-settle,
        .content.ptr-settle,
        .ptr-fresh > * {
            transition: none;
            animation: none;
        }
    }
