/**
 * Einheitliche Aktionsleiste: Feed-Posts + Entdecken/Suche (gleiche Position rechts).
 */

/* Rail am Kartenrand, nicht im Flex-Overlay (sonst rutscht der Text unten weg) */
.ta-tiktok-post-overlay .ta-explore-rail {
    display: none !important;
}

.ta-ng-feed-item .ta-explore-rail,
.ta-tiktok-post-card .ta-explore-rail {
    position: absolute;
    right: var(--ta-feed-actions-right, 14px);
    bottom: calc(var(--ta-safe-bottom, env(safe-area-inset-bottom, 16px)) + var(--ta-feed-actions-offset, 108px) + var(--ta-feed-actions-rise, 8px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ta-explore-rail-gap, 16px);
    z-index: 12;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

.ta-explore-rail__btn--icon.btn-listing-detail .ta-explore-rail__glyph--business svg {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ta-explore-rail__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 54px;
}

.ta-explore-rail__btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.ta-explore-rail__btn:active {
    transform: scale(0.9);
}

.ta-explore-rail__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* Standard-Icons (Herz, Kommentar, Profil, Teilen) */
.ta-explore-rail__btn--icon .ta-explore-rail__glyph {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ta-explore-rail__btn--icon .ta-explore-rail__glyph svg {
    width: 28px;
    height: 28px;
    display: block;
    fill: #fff;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.85));
}

.ta-explore-rail__btn--icon .ta-explore-rail__glyph--comment svg {
    width: 28px;
    height: 28px;
}

.ta-explore-rail__btn--icon .ta-explore-rail__glyph--comment svg path {
    fill: inherit;
}

.ta-explore-rail__glyph--share svg {
    width: 26px;
    height: 26px;
}

.ta-explore-rail__btn--icon.btn-profile .ta-explore-rail__glyph svg {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ta-explore-rail__btn--icon.btn-like.is-liked .ta-explore-rail__glyph svg,
.ta-explore-rail__btn--icon.btn-like.is-liked .ta-explore-rail__glyph--like svg,
.ta-explore-rail__btn--icon.btn-listing-like.is-liked .ta-explore-rail__glyph svg,
.ta-explore-rail__btn--icon.btn-listing-like.is-liked .ta-explore-rail__glyph--like svg,
.ta-explore-rail__btn--icon.btn-user-like.is-liked .ta-explore-rail__glyph svg,
.ta-explore-rail__btn--icon.btn-user-like.is-liked .ta-explore-rail__glyph--like svg {
    fill: #fe2c55;
    filter: drop-shadow(0 0 8px rgba(254, 44, 85, 0.55));
}

/* Folgen: weißer Kreis + Plus oben */
.ta-explore-rail__btn--follow .ta-explore-rail__glyph--follow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.ta-explore-rail__btn--follow .ta-explore-rail__glyph--follow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #161616;
    stroke-width: 2.5;
    filter: none;
}

.ta-explore-rail__btn--follow.is-following .ta-explore-rail__glyph--follow {
    background: #fe2c55;
    box-shadow: 0 0 16px rgba(254, 44, 85, 0.55);
}

.ta-explore-rail__btn--follow.is-following .ta-explore-rail__glyph--follow svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    stroke: none;
}

.ta-explore-rail__count,
.ta-explore-rail__label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    min-height: 14px;
    letter-spacing: 0.01em;
    text-align: center;
}

.ta-explore-rail__label {
    display: block;
    max-width: 56px;
    white-space: nowrap;
}

.ta-explore-rail__count--ghost {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

/* Benutzer-Karte: Vollbild-Avatar, dezente Info unten */
.ta-tiktok-user-card .ta-ng-feed-media--user,
.ta-tiktok-user-card .ta-ng-feed-media--user-fallback {
    object-fit: cover;
    object-position: center top;
}

.ta-tiktok-user-card .ta-ng-feed-info {
    left: 16px;
    right: var(--ta-feed-actions-reserve, 88px);
    width: auto;
}

/* Kommentar-Drawer (Standorte + Benutzer-Pinnwand) am body */
.ta-explore-comments-sheet {
    --ta-explore-sheet-backdrop: rgba(0, 0, 0, 0.55);
    --ta-explore-sheet-bg: rgba(12, 14, 24, 0.98);
    --ta-explore-sheet-bg-footer: rgba(10, 12, 20, 0.98);
    --ta-explore-sheet-text: #fff;
    --ta-explore-sheet-text-muted: rgba(255, 255, 255, 0.62);
    --ta-explore-sheet-text-soft: rgba(255, 255, 255, 0.88);
    --ta-explore-sheet-border: rgba(255, 255, 255, 0.08);
    --ta-explore-sheet-surface: rgba(255, 255, 255, 0.06);
    --ta-explore-sheet-surface-strong: rgba(255, 255, 255, 0.08);
    --ta-explore-sheet-input-bg: rgba(255, 255, 255, 0.05);
    --ta-explore-sheet-input-border: rgba(255, 255, 255, 0.1);
    --ta-explore-sheet-placeholder: rgba(255, 255, 255, 0.42);
    --ta-explore-sheet-handle: rgba(255, 255, 255, 0.52);
    --ta-explore-sheet-handle-hover: rgba(255, 255, 255, 0.85);
    --ta-explore-sheet-shadow: 0 -24px 60px rgba(0, 0, 0, 0.4);
    --ta-explore-sheet-cancel-bg: rgba(255, 255, 255, 0.04);
    --ta-explore-sheet-cancel-border: rgba(255, 255, 255, 0.12);
    --ta-explore-sheet-link: var(--ta-neon-primary, #00f2fe);
}

html:not([data-lp-color-scheme="dark"]) .ta-explore-comments-sheet {
    --ta-explore-sheet-backdrop: rgba(15, 23, 42, 0.42);
    --ta-explore-sheet-bg: rgba(255, 255, 255, 0.98);
    --ta-explore-sheet-bg-footer: #f8fafc;
    --ta-explore-sheet-text: var(--lp-text-main, #0f172a);
    --ta-explore-sheet-text-muted: var(--lp-text-muted, #64748b);
    --ta-explore-sheet-text-soft: #334155;
    --ta-explore-sheet-border: rgba(15, 23, 42, 0.1);
    --ta-explore-sheet-surface: rgba(15, 23, 42, 0.04);
    --ta-explore-sheet-surface-strong: rgba(15, 23, 42, 0.07);
    --ta-explore-sheet-input-bg: #fff;
    --ta-explore-sheet-input-border: rgba(15, 23, 42, 0.14);
    --ta-explore-sheet-placeholder: #94a3b8;
    --ta-explore-sheet-handle: #64748b;
    --ta-explore-sheet-handle-hover: #0f172a;
    --ta-explore-sheet-shadow: 0 -20px 48px rgba(15, 23, 42, 0.16);
    --ta-explore-sheet-cancel-bg: #fff;
    --ta-explore-sheet-cancel-border: rgba(15, 23, 42, 0.12);
    --ta-explore-sheet-link: #0e7490;
}

.ta-explore-comments-sheet[hidden] {
    display: none !important;
}

body.ta-explore-comments-open,
body.ta-profile-wall-open {
    overflow: hidden;
}

.ta-explore-comments-sheet,
.ta-profile-wall-sheet,
.ta-listing-comments-sheet,
.ta-feed-post-comments-sheet {
    position: fixed;
    inset: 0;
    z-index: 3200;
    pointer-events: none;
}

.ta-explore-comments-sheet:not([hidden]),
.ta-profile-wall-sheet:not([hidden]),
.ta-listing-comments-sheet:not([hidden]),
.ta-feed-post-comments-sheet:not([hidden]) {
    pointer-events: auto;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__backdrop {
    position: fixed;
    inset: 0;
    z-index: 3201;
    background: var(--ta-explore-sheet-backdrop);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__panel {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 3202;
    width: min(100%, 480px);
    max-height: min(78dvh, 760px);
    transform: translateX(-50%);
    border-radius: 24px 24px 0 0;
    background: var(--ta-explore-sheet-bg);
    border: 1px solid var(--ta-explore-sheet-border);
    color: var(--ta-explore-sheet-text);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    box-shadow: var(--ta-explore-sheet-shadow);
    box-sizing: border-box;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--ta-explore-sheet-border);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__head h3 {
    margin: 0;
    font-size: 1.02rem;
    color: var(--ta-explore-sheet-text);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__head p {
    margin: 4px 0 0;
    color: var(--ta-explore-sheet-text-muted);
    font-size: 0.82rem;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ta-explore-sheet-surface-strong);
    color: var(--ta-explore-sheet-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__context {
    padding: 14px 18px;
    border-bottom: 1px solid var(--ta-explore-sheet-border);
    min-width: 0;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ta-explore-sheet-surface-strong);
    color: var(--ta-explore-sheet-text);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    font-weight: 800;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__meta {
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__meta strong {
    display: inline;
    font-size: 0.95rem;
    color: var(--ta-explore-sheet-text);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__meta .ta-wall-comment__handle,
.ta-explore-comments-sheet .ta-post-comments-sheet__meta #ta-listing-comments-city {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ta-explore-sheet-handle);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__meta a.ta-wall-comment__handle {
    color: var(--ta-explore-sheet-link);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__meta a.ta-wall-comment__handle:hover,
.ta-explore-comments-sheet .ta-post-comments-sheet__meta a.ta-wall-comment__handle:focus-visible {
    color: var(--ta-explore-sheet-handle-hover);
    text-decoration: underline;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__body {
    margin: 10px 0 0;
    color: var(--ta-explore-sheet-text-soft);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__body:empty {
    display: none;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__list {
    overflow-y: auto;
    padding: 10px 18px 18px;
    display: grid;
    gap: 12px;
    min-height: 0;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__empty {
    color: var(--ta-explore-sheet-text-muted);
    font-size: 0.92rem;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

.ta-wall-comment {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--ta-explore-sheet-surface);
    border: 1px solid var(--ta-explore-sheet-border);
}

.ta-wall-comment__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.ta-wall-comment__author {
    display: inline;
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    color: var(--ta-explore-sheet-text);
}

.ta-wall-comment__handle {
    color: var(--ta-explore-sheet-handle);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.3;
}

.ta-explore-comments-sheet .ta-wall-comment__handle {
    color: var(--ta-explore-sheet-link);
}

.ta-wall-comment__handle:hover,
.ta-wall-comment__handle:focus-visible {
    color: var(--ta-explore-sheet-handle-hover);
    text-decoration: underline;
    outline: none;
}

.ta-wall-comment__body {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--ta-explore-sheet-text-soft);
    word-break: break-word;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__form,
.ta-explore-comments-sheet .ta-post-comments-sheet__login {
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ta-explore-sheet-border);
    background: var(--ta-explore-sheet-bg-footer);
    min-width: 0;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__form textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border-radius: 16px;
    border: 1px solid var(--ta-explore-sheet-input-border);
    background: var(--ta-explore-sheet-input-bg);
    color: var(--ta-explore-sheet-text);
    padding: 12px 14px;
    box-sizing: border-box;
    font: inherit;
    display: block;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__form textarea::placeholder {
    color: var(--ta-explore-sheet-placeholder);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__form textarea:focus {
    outline: none;
    border-color: var(--ta-explore-sheet-link);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ta-explore-sheet-link) 28%, transparent);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.ta-explore-comments-sheet .ta-post-comments-sheet__cancel {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--ta-explore-sheet-cancel-border);
    background: var(--ta-explore-sheet-cancel-bg);
    color: var(--ta-explore-sheet-text);
    font-weight: 700;
    cursor: pointer;
    font: inherit;
    text-align: center;
}

.ta-explore-comments-sheet .ta-tiktok-btn-primary,
.ta-explore-comments-sheet .ta-comments-sheet-submit {
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    background: #fe2c55;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    font-family: inherit;
}

.ta-explore-comments-sheet .ta-comments-sheet-submit {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
    text-align: center;
}

.ta-explore-comments-sheet .ta-comments-sheet-submit:active {
    transform: scale(0.98);
}

.ta-explore-comments-sheet .ta-post-comments-sheet__login .ta-tiktok-btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

