:root
{
    --tg-blue: #2A82E4;
    --tg-bg: #ffffff;
    --tg-bg-alt: #f4f7fb;
    --tg-border: #e6ebf2;
    --tg-text: #0f141a;
    --tg-muted: #6b7b8d;
}

body
{
    background-color: var(--bg-custom) !important;
}

.tg
{
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Color Emoji", "Apple Color Emoji", sans-serif;
    background: var(--tg-bg);
    color: var(--tg-text);
}

.tg *
{
    font-family: -apple-system, BlinkMacSystemFont,
    "SF Pro Text", "Segoe UI", Roboto, Inter, "Helvetica Neue",
    Arial, sans-serif;
}

.tg .mi
{
    font-family: "Material Symbols Rounded", serif;
}

.tg-list
{
    max-width: 680px;
    margin: 0 auto;
    padding-bottom: 140px;
    padding-top: 60px;
}

.statuses-top-tabs
{
    max-width: 680px;
    padding: 0 16px;
}

.statuses-list-wrapper
{
    position: relative;
}

.page-section-intro
{
    max-width: 680px;
    margin: 0 auto 16px;
    padding: 8px 16px 0;
}

.page-section-intro__head
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.page-section-intro__title
{
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-text);
}

.page-section-intro__text
{
    margin: 0;
    font-size: 14px;
    color: var(--tg-muted);
}

.statuses-nearby-toggle
{
    position: fixed;
    right: max(16px, calc((100vw - 680px) / 2 + 16px));
    top: 76px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d1dbef;
    background: #f4f8ff;
    color: #1f3f8e;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 14px;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(31, 63, 142, .18);
}

.statuses-nearby-toggle__icon
{
    font-size: 16px;
    line-height: 1;
}

.statuses-nearby-panel
{
    max-width: 680px;
    margin: 0 auto 12px;
    padding: 0 16px;
}

.statuses-loader
{
    position: absolute;
    right: 30px;
    bottom: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.statuses-loader__spinner
{
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(63, 81, 181, 0.2);
    border-top-color: #3f51b5;
    animation: statuses-loader-spin 0.8s linear infinite;
}

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

.empty-state-container
{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 0 16px 120px;
    flex-direction: column;
}

.empty-state
{
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 48px 32px;
    border-radius: 24px;
    border: 1px dashed var(--tg-border);
    background: linear-gradient(180deg, rgba(244, 247, 251, .7), rgba(244, 247, 251, .4));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.empty-state__illustration
{
    width: 160px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state__illustration svg
{
    width: 100%;
    height: 100%;
    display: block;
}

.empty-state__title
{
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--tg-muted);
    font-family: var(--font-display);
}

.empty-state__text
{
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(15, 20, 26, .55);
    max-width: 320px;
}

.empty-state__button
{
    border: none;
    background: var(--accent-custom);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(42, 130, 228, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}

.empty-state__button:hover
{
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(42, 130, 228, .28);
}

.empty-state__button:active
{
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(42, 130, 228, .2);
}

.tg-msg
{
    display: grid;
    grid-template-columns: 12px 1fr;
    grid-template-areas: "avatar body";
    column-gap: 2px;
    align-items: flex-start;
    padding: 6px 2px;
    margin: 12px 0;
    background: transparent !important;
    cursor: pointer;
    transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
    position: relative;
    touch-action: manipulation;
}

.tg-msg-body
{
    grid-area: body;
    display: flex;
    flex-direction: column;
    background: var(--tg-bg);
    box-shadow: 1px 1px 15px #888;
    border-radius: 20px;
    overflow: hidden;
}

.tg-msg .tg-content
{
    padding: 20px;
}

.tg-msg.w-image .tg-content
{
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.tg-msg.tg-msg--mine  .tg-msg-body
{
}

.tg-msg:active
{
    transform: translateY(1px);
}

.tg .interest-filter-panel
{
    max-width: 680px;
    margin: 0 auto 12px;
    padding: 0 16px 8px;
}

.interest-filter-panel--statuses
{
    margin-top: 0;
}

.tg .interest-filter-panel__scroller
{
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 4px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tg .interest-filter-panel__scroller::-webkit-scrollbar
{
    display: none;
}

.tg .interest-chip
{
    border: 1px solid rgba(18, 72, 124, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(15, 20, 26, 0.8);
    cursor: pointer;
    outline: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 0 rgba(42, 130, 228, 0);
}

.tg .interest-chip__label
{
    pointer-events: none;
}

.tg .interest-chip--active
{
    border-color: transparent;
    background: var(--accent-custom, #2A82E4);
    color: #ffffff;
}

.tg .interest-chip:focus-visible
{
    box-shadow: 0 0 0 2px rgba(42, 130, 228, 0.25);
}

.tg-avatar
{
    grid-area: avatar;
    align-self: start;
    width: 32px;
    height: 32px;
    border-radius: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #dbe7ff 100%);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #26457c;
    font-size: 18px;
    position: relative;
    left: 3px;
    top: -9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tg-avatar--photo
{
    background-size: cover;
    background-position: center;
}

.tg-avatar__initials
{
    letter-spacing: 1px;
}

.status-card__cover
{
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    width: 100%;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(244, 247, 251, 1), rgba(232, 239, 252, 1));
    aspect-ratio: 16 / 5;
    min-height: 160px;
}

.tg-msg__cover
{
    margin-bottom: 0;
}

.status-card__cover img
{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tg-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tg-header__title
{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tg-text);
    margin-bottom: 12px;
    font-family: var(--font-display);
}

.tg-header__badge
{
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(42, 130, 228, .15);
    color: var(--accent-custom);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tg-header__rank
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(42, 130, 228, .16);
    color: var(--accent-custom);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.tg-header__text
{
    display: inline;
    font-family: var(--font-display);
}

.tg-llm-indicator
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 18px;
    line-height: 1;
}

.tg-llm-indicator .mi
{
    display: inline-block;
}

.tg-llm-indicator__percent
{
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.tg-llm-indicator--empty
{
    position: relative;
    color: #9aa7bd;
}

.tg-llm-indicator--empty::after
{
    content: '';
    position: absolute;
    width: 120%;
    height: 2px;
    left: -10%;
    top: 50%;
    background: currentColor;
    transform: rotate(-45deg);
}

.tg-start-row
{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 20px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-custom);
}

.tg-header__date
{
    white-space: nowrap;
}

.tg-header__tz
{
    font-size: 11px;
    font-weight: 500;
    color: rgba(42, 130, 228, .7);
}

.tg-desc
{
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    font-family: var(--font-description);
    white-space: pre-line;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.tg-msg--mine .tg-desc--fade::after
{
}


.tg-desc--fade::after
{
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9) 40%, #fff 100%);
}

.tg-meta
{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    margin-top: 4px;
}

.tg-participants
{
    order: 1;
}

.tg-countdown
{
    order: 2;
}

.tg-interest
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(47, 27, 15, 0.12);
    color: #2f1b0f;
    font-weight: 600;
    font-size: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
    white-space: normal;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tg-interest__label
{
    font-weight: 600;
}
.tg-interest__name
{
    font-weight: 700;
}
.tg-interest__icons
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}
.tg-interest__icons .rating-star
{
    position: relative;
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    color: rgba(242, 160, 7, 0.35);
}
.tg-interest__icons .rating-star::before
{
    content: '\2606';
    color: inherit;
}
.tg-interest__icons .rating-star--full
{
    color: #f2a007;
}
.tg-interest__icons .rating-star--full::before
{
    content: '\2605';
}
.tg-interest__icons .rating-star--half::before
{
    content: '\2606';
}
.tg-interest__icons .rating-star--half::after
{
    content: '\2605';
    color: #f2a007;
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    white-space: nowrap;
}
.tg-interest__icons .rating-star--empty
{
    color: rgba(242, 160, 7, 0.25);
}

.tg-participants
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(42, 130, 228, .1);
    color: var(--accent-custom);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.tg-participants--empty
{
    background: rgba(107, 123, 141, .12);
    color: rgba(15, 20, 26, .55);
}

.tg-countdown
{
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 151, 60, .16);
    color: #d95d04;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.tg-debug-edges__toggle
{
    align-self: flex-start;
    margin-top: 4px;
    padding: 4px 12px;
    border-radius: 10px;
    border: 1px solid var(--tg-border);
    background: var(--tg-bg-alt);
    color: var(--tg-muted);
    font-size: 12px;
    font-weight: 600;
    width: 130px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.tg-debug-edges__toggle:hover
{
    background: rgba(42, 130, 228, .12);
    border-color: rgba(42, 130, 228, .4);
    color: var(--accent-custom);
}

.tg-debug-edges
{
    width: 100%;
    margin-top: 8px;
    border: 1px dashed var(--tg-border);
    border-radius: 12px;
    background: var(--tg-bg-alt);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--tg-text);
}

.tg-debug-edges__list
{
    list-style: disc inside;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tg-debug-edges__empty
{
    margin: 0;
    color: var(--tg-muted);
    font-style: italic;
}

.gray-text
{
    font-size: 14px;
    color: gray;
}

.tg-llm-hint
{
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(42, 130, 228, .08);
    border: 1px solid rgba(42, 130, 228, .18);
    color: rgba(15, 20, 26, .78);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-line;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.tg-type
{
    order: 3;
    flex: 0 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(15, 20, 26, .06);
    color: rgba(15, 20, 26, .65);
    text-transform: capitalize;
}

.tg-date
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--tg-muted);
}

.tg-date__tz
{
    font-size: 12px;
    color: var(--tg-muted);
    white-space: nowrap;
}

.tg-pill
{
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(42, 130, 228, .12);
    color: var(--accent-custom);
}

/* прогресс как у тг-аплоада */
.tg-progress
{
    grid-column: 2 / -1;
    height: 6px;
    margin-top: 8px;
    background: var(--tg-bg-alt);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.tg-progress__bar
{
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--value, 50%);
    background: #ddbd83;
    border-radius: inherit;
    transition: width .4s ease;
}

/* низкий остаток — мигаем */
.tg-progress__bar--low
{
    animation: tg-blink 1.9s steps(1, end) infinite;
}

@keyframes tg-blink
{
    0%, 100%
    {
        background-color: var(--accent-custom);
    }
    50%
    {
        background-color: #f15959;
    }
}

.tg-title .gray-text
{
    color: gray;
}
.tg-avatar__badge
{
    grid-column: 1;
    grid-row: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(42, 130, 228, .15);
    color: var(--accent-custom);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.status-membership-action {
    margin-top: 6px;
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
}

.status-membership-btn {
    border: 1px solid #d6ddee;
    background: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    color: #5b6478;
    white-space: nowrap;
    max-width: 100%;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.status-membership-btn.is-active {
    border-color: #6f90ff;
    background-color: rgba(111, 144, 255, 0.14);
    color: #3e5bc7;
}

.status-membership-btn__icon {
    font-size: 15px;
    line-height: 1;
}

.status-membership-btn.is-loading,
.status-membership-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 420px) {
    .tg-meta {
        gap: 6px;
        min-height: 24px;
    }

    .tg-type,
    .tg-participants,
    .tg-countdown {
        padding: 3px 8px;
        font-size: 11px;
    }

    .status-membership-btn {
        padding: 4px 9px;
        font-size: 11px;
        gap: 4px;
    }
}
