/* postview.css — страница объявления.
   Телефон: одна колонка (галерея → заголовок → карточка с ценой → описание).
   Десктоп (≥ 980px): контент слева, карточка с ценой и контактами закреплена справа. */

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

.canvas_f.pv-page {
    gap: 0;
    padding: 56px 0 120px;
}

/* ---------- Хлебные крошки ---------- */
.pv-crumbs {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 1160px;
    box-sizing: border-box;
    padding: 18px 24px 12px;
    font-size: 13px;
    color: var(--tl-ink-3);
}
.pv-crumbs a, .pv-crumbs a:visited { color: var(--tl-ink-2); }
.pv-crumbs a:hover { color: var(--tl-blue); }
.pv-crumbs i { font-size: 9px; }

/* ---------- Сетка ---------- */
.pv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "gallery"
        "head"
        "side"
        "body";
    width: 100%;
    max-width: 640px;
    box-sizing: border-box;
}

.pv-gallery { grid-area: gallery; }
.pv-head    { grid-area: head; }
.pv-side    { grid-area: side; }
.pv-body    { grid-area: body; min-width: 0; }

.pv-head, .pv-side, .pv-body { padding: 0 16px; }

/* ---------- Галерея ---------- */
.post-carousel-container {
    position: relative;
    overflow: hidden;
    background: var(--tl-surface-2);
}

.carousel-postview {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-height: 72vh;
    aspect-ratio: 4 / 3;
    touch-action: manipulation;
    overflow: hidden;
}

/* Размытая подложка из текущего фото — заполняет поля у вертикальных снимков */
.carousel-postview::before {
    content: "";
    position: absolute;
    inset: -20px;
    background: var(--carousel-bg-image) center / cover no-repeat;
    filter: blur(24px) brightness(.85);
    z-index: 0;
}

.carousel-inner {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.carousel-image.active { display: block; animation: pv-fade .3s ease; }

@keyframes pv-fade { from { opacity: .5; } to { opacity: 1; } }

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--tl-shadow-1);
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease;
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-prev::before,
.carousel-next::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border: solid var(--tl-navy);
    border-width: 2px 2px 0 0;
    transform: translate(-35%, -50%) rotate(-135deg);
}
.carousel-next::before { transform: translate(-65%, -50%) rotate(45deg); }

.carousel-postview:hover .carousel-prev,
.carousel-postview:hover .carousel-next { opacity: 1; }

/* На тач-экранах стрелки не нужны — работает свайп, а края фото остаются кликабельными */
@media (hover: none) {
    .carousel-prev, .carousel-next {
        top: 0; bottom: 0; height: auto; width: 22%; margin: 0;
        border-radius: 0; background: transparent; box-shadow: none; opacity: 1;
    }
    .carousel-prev::before, .carousel-next::before { display: none; }
    .carousel-prev { left: 0; }
    .carousel-next { right: 0; }
}

.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}
.carousel-indicator {
    position: relative;
    width: 12px;
    height: 6px;
    cursor: pointer;
    pointer-events: auto;
}
.carousel-indicator::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 20px;
    height: 6px;
    margin-left: -10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    transform: scaleX(.3);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), background .3s ease;
}
.carousel-indicator.active::before { transform: scaleX(.7); background: #fff; }

.carousel-single .carousel-prev,
.carousel-single .carousel-next,
.carousel-single .carousel-indicators { display: none !important; }

.pv-photo-count {
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(7, 10, 28, .55);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
}

.invisible-center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: zoom-in;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Заголовок ---------- */
.pv-head { padding-top: 18px; }

.pv-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Категория — в цвете своей плитки из ленты (те же переменные --tag-icon*) */
.pv-cat,
.pv-cat:visited {
    --cat: var(--tl-blue);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px 0 10px;
    border-radius: 999px;
    border: 1px solid var(--tl-line);
    background: var(--tl-surface);
    color: var(--tl-ink);
    font-size: 13px;
    font-weight: 600;
}
@supports (background: color-mix(in srgb, red 10%, white)) {
    .pv-cat, .pv-cat:visited {
        background: color-mix(in srgb, var(--cat) 12%, var(--tl-surface));
        border-color: color-mix(in srgb, var(--cat) 35%, transparent);
    }
}
.pv-cat i { font-size: 14px; color: var(--cat); }
.pv-cat:hover { border-color: var(--cat); }

.pv-cat[data-color="1"]  { --cat: var(--tag-icon1); }
.pv-cat[data-color="2"],
.pv-cat[data-color="3"],
.pv-cat[data-color="4"],
.pv-cat[data-color="5"]  { --cat: var(--tag-icon2); }
.pv-cat[data-color="6"],
.pv-cat[data-color="7"]  { --cat: var(--tag-icon1); }
.pv-cat[data-color="8"],
.pv-cat[data-color="9"],
.pv-cat[data-color="10"] { --cat: var(--tag-icon3); }
.pv-cat[data-color="11"] { --cat: var(--tag-icon4); }
.pv-cat[data-color="12"] { --cat: var(--tag-icon5); }

.pv-date { font-size: 13px; color: var(--tl-ink-3); }

.pv-head .post-title {
    margin: 0;
    font-family: var(--tl-font-display);
    font-size: clamp(22px, 5.6vw, 32px);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--tl-ink);
    overflow-wrap: anywhere;
}

.pv-head .post-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    font-size: 15px;
    color: var(--tl-ink-2);
}
.pv-head .post-address i { color: var(--tl-blue); margin-top: 3px; }
/* Город — ссылка на страницу города, выглядит как текст адреса */
.pv-head .post-address__city { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.pv-head .post-address__city:hover { color: var(--tl-blue); }

/* ---------- Карточка: цена, контакты, автор ---------- */
.pv-side { padding-top: 18px; }

.pv-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-r-l);
    box-shadow: var(--tl-shadow-1);
}

.pv-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }

.pv-card .post-price {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--tl-ink);
    white-space: nowrap;
}
.pv-price-unit { font-size: 14px; color: var(--tl-ink-3); }

.pv-card .post-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phone-btn-wrap { position: relative; display: flex; }

.phone-btn,
.pv-btn,
.pv-btn:visited {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s ease, transform .1s ease, background-color .15s ease;
}
.phone-btn {
    background: var(--tl-magenta);
    color: #fff;
    box-shadow: 0 8px 20px rgba(229, 0, 127, .25);
}
.phone-btn:hover { filter: brightness(1.06); }
.phone-btn:active, .pv-btn:active { transform: scale(.98); }

.pv-btn--ghost,
.pv-btn--ghost:visited {
    background: var(--tl-surface-2);
    color: var(--tl-ink);
}
.pv-btn--ghost:hover { background: var(--tl-surface-3); }

/* Всплывающий номер */
.phone-number {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    z-index: 20;
    padding: 12px 18px;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-r-m);
    background: var(--tl-surface);
    box-shadow: var(--tl-shadow-2);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    white-space: nowrap;
    color: var(--tl-ink);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px) scale(.96);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.phone-number.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    pointer-events: auto;
}
.phone-number::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin: -5px 0 0 -5px;
    width: 10px;
    height: 10px;
    background: var(--tl-surface);
    border-right: 1px solid var(--tl-line);
    border-bottom: 1px solid var(--tl-line);
    transform: rotate(45deg);
}
.phone-number .phone-number-value,
.phone-number .phone-number-value:visited { color: var(--tl-ink); }

/* Автор + иконки */
.username-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--tl-line);
}

.pv-author,
.pv-author:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--tl-ink);
}
.pv-author__img {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.pv-author__img--letter {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tl-grad);
    color: #fff;
    font-family: var(--tl-font-display);
    font-weight: 600;
    font-size: 18px;
}
.pv-author__text { display: flex; flex-direction: column; min-width: 0; }
.pv-author .post-username {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pv-author__sub { font-size: 13px; color: var(--tl-blue); }
.pv-author:hover .pv-author__sub { text-decoration: underline; }

.pv-icons { display: flex; gap: 6px; flex-shrink: 0; }

.pv-icon,
#share.pv-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: var(--tl-surface-2);
    color: var(--tl-ink-2);
    font-size: 17px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.pv-icon:hover { background: var(--tl-surface-3); color: var(--tl-ink); }
#share i { color: inherit; font-size: 17px; }

.like-btn.liked { color: var(--tl-magenta); background: var(--tl-magenta-soft); }

/* ---------- Основной текст ---------- */
.pv-body { padding-top: 6px; }

.post-details-postview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.post-details-postview .post-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 84px;
    padding: 10px 14px;
    border-radius: var(--tl-r-m);
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
}
.post-details-postview .post-detail b { font-size: 17px; font-weight: 700; color: var(--tl-ink); }
.post-details-postview .post-detail i { font-style: normal; font-size: 12.5px; color: var(--tl-ink-3); }

.pv-section { margin-top: 28px; }

.pv-h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-family: var(--tl-font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--tl-ink);
}
.pv-count {
    font-family: var(--tl-font);
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--tl-surface-2);
    color: var(--tl-ink-2);
}

.post-text-full {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--tl-ink);
    max-width: 68ch;
    overflow-wrap: anywhere;
}
.post-text-full:empty { display: none; }

.post-text-full a.external-link,
.post-text-full a.phone-number-link { color: var(--tl-blue); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Карта ---------- */
.pv-map-address {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0 0 12px;
    color: var(--tl-ink-2);
    font-size: 15px;
}
.pv-map-address i { color: var(--tl-blue); margin-top: 3px; }

.map-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--tl-line);
    border-radius: 12px;
    background: var(--tl-surface);
    color: var(--tl-ink);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
.map-toggle-btn i { color: var(--tl-blue); }
.map-toggle-btn:hover { border-color: var(--tl-ink-3); }

.post-map-container {
    overflow: hidden;
    border-radius: var(--tl-r-l);
    border: 1px solid var(--tl-line);
    background: var(--tl-surface-2);
}
.post-map-container.hidden { display: none; }

.post-map { width: 100%; height: 320px; position: relative; }
.post-map::before {
    content: "Загружаем карту…";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--tl-ink-3);
}
.post-map.loaded::before { display: none; }

.ymaps-2-1-79-balloon__tail { display: none; }

/* ---------- Связанные объявления ---------- */
.chain-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.chain-post,
.chain-post:visited {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 18px;
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
    color: var(--tl-ink);
    cursor: pointer;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.chain-post:hover { box-shadow: var(--tl-shadow-2); border-color: transparent; transform: translateY(-1px); }

.chain-post-image { flex: 0 0 72px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--tl-surface-2); }
.chain-post-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chain-post-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 4px 4px 4px 0; }
.chain-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chain-post-address { font-size: 12.5px; color: var(--tl-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain-post-address::before { content: "\f3c5"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 10.5px; color: var(--tl-magenta); margin-right: 5px; }
.chain-post-price { font-family: var(--tl-font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-top: auto; }

/* ---------- Подвал объявления ---------- */
.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--tl-line);
}
.post-footer-left { position: relative; }
.post-meta-info { font-size: 13px; color: var(--tl-ink-3); }

.post-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--tl-ink-3);
    font-size: 16px;
    cursor: pointer;
}
.post-actions-toggle:hover { background: var(--tl-surface-2); color: var(--tl-ink); }

.post-actions-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 30;
    min-width: 230px;
    padding: 6px;
    border-radius: var(--tl-r-m);
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
    box-shadow: var(--tl-shadow-2);
}
.post-actions-menu .dislike-btn,
.post-actions-menu .report-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--tl-ink);
    cursor: pointer;
}
.post-actions-menu .dislike-btn i,
.post-actions-menu .report-link i { width: 16px; color: var(--tl-ink-3); }
.post-actions-menu .dislike-btn:hover,
.post-actions-menu .report-link:hover { background: var(--tl-surface-2); }
.post-actions-menu .report-link { color: var(--tl-danger); }
.post-actions-menu .report-link i { color: var(--tl-danger); }

/* Жалоба */
.report-form {
    display: none;
    margin-top: 14px;
    padding: 16px;
    border-radius: var(--tl-r-m);
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
}
.report-form__title { margin: 0 0 10px; font-weight: 600; color: var(--tl-ink); }
.report-textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 96px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--tl-line);
    background: var(--tl-surface-2);
    color: var(--tl-ink);
    font-size: 16px;
    resize: vertical;
}
.report-textarea:focus { outline: none; border-color: var(--tl-blue); box-shadow: 0 0 0 3px var(--tl-blue-soft); }
.report-textarea::placeholder { color: var(--tl-ink-3); }
.report-buttons { display: flex; gap: 8px; margin-top: 10px; }
.report-buttons .submit_button,
.report-buttons .signup_button { height: 44px; border-radius: 12px; font-size: 15px; min-width: 0; }
.report-buttons .submit_button { background: var(--tl-danger); }
.report-buttons .signup_button { background: var(--tl-surface-2); color: var(--tl-ink); }
.report-message { margin-top: 10px; font-size: 14px; }
.report-success { color: var(--tl-green); }
.report-error { color: var(--tl-danger); }

/* ---------- Обсуждение ---------- */
.comments-container { margin-top: 32px; scroll-margin-top: 72px; }

.comments-section {
    padding: 18px;
    border-radius: var(--tl-r-l);
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
}
.comments-header .pv-h2 { margin-bottom: 14px; }

.comment-form { margin-bottom: 14px; }

.comment-input-container {
    position: relative;
    border-radius: var(--tl-r-m);
    background: var(--tl-surface-2);
    border: 1px solid transparent;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.comment-input-container:focus-within { border-color: var(--tl-blue); box-shadow: 0 0 0 3px var(--tl-blue-soft); background: var(--tl-surface); }

.text_input_comment {
    box-sizing: border-box;
    width: 100%;
    min-height: 54px;
    padding: 14px 60px 14px 16px;
    border: none;
    background: transparent;
    color: var(--tl-ink);
    font-size: 16px;
    line-height: 1.4;
    resize: none;
    outline: none;
}
.text_input_comment::placeholder { color: var(--tl-ink-3); }

.comment-input-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px 8px 12px;
}
.reply-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--tl-ink-2);
    min-height: 0;
}
.reply-preview:empty { display: none; }
.no-reply-button {
    border: none;
    background: none;
    color: var(--tl-ink-3);
    cursor: pointer;
    font-size: 14px;
}

.comment-submit-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--tl-magenta);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}
.comment-submit-btn:active { transform: scale(.94); }

.comment-notice {
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: var(--tl-r-m);
    background: var(--tl-surface-2);
    color: var(--tl-ink-2);
    font-size: 14px;
}
.comment-notice a, .comment-notice a:visited { color: var(--tl-blue); font-weight: 600; }

.comments-list {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--tl-line) transparent;
}
.comments-list::-webkit-scrollbar { width: 4px; }
.comments-list::-webkit-scrollbar-thumb { border-radius: 2px; background: var(--tl-line); }
.comments-list:has(.comment) .pv-comments-empty { display: none; }

.pv-comments-empty { margin: 0; font-size: 14px; color: var(--tl-ink-3); }

.comment {
    position: relative;
    max-width: 88%;
    padding: 10px 14px 11px;
    border-radius: 16px;
    overflow-wrap: anywhere;
    animation: pv-pop .25s ease;
}
@keyframes pv-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.user-comment {
    align-self: flex-start;
    background: var(--tl-surface-2);
    color: var(--tl-ink);
    border-bottom-left-radius: 6px;
}
.owner-comment {
    align-self: flex-end;
    background: var(--tl-blue-soft);
    color: var(--tl-ink);
    border-bottom-right-radius: 6px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 3px;
}
.comment-info { display: flex; align-items: center; gap: 6px; min-width: 0; }
.comment-author,
.comment-author:visited { font-size: 13px; font-weight: 600; color: var(--tl-blue); }
.comment-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--tl-blue);
    color: #fff;
}

.comment-quote {
    display: block;
    width: 100%;
    margin: 2px 0 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 71, 255, .06);
    color: var(--tl-ink-2);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.comment-quote b { color: var(--tl-ink); font-weight: 600; }
.comment-quote-gone { cursor: default; font-style: italic; }
.comment-quote.is-hidden { display: none; }

.comment-flash { animation: comment-flash 1.4s ease; }
@keyframes comment-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--tl-amber); } 100% { box-shadow: 0 0 0 0 transparent; } }

.comment-text { font-size: 15px; line-height: 1.45; }

.comment-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.reply-btn,
.delete-comment-btn {
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    color: var(--tl-ink-3);
    cursor: pointer;
}
.reply-btn:hover { color: var(--tl-blue); }
.delete-comment-btn:hover { color: var(--tl-danger); }

.load-more-comments { display: flex; justify-content: center; margin-top: 12px; }
.load-more-comments button {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: var(--tl-surface-2);
    color: var(--tl-ink);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.load-more-comments button:hover { background: var(--tl-surface-3); }

/* ---------- Нижняя панель на телефоне ---------- */
.pv-bar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 16px;
    border-radius: 18px;
    background: var(--tl-surface);
    border: 1px solid var(--tl-line);
    box-shadow: var(--tl-shadow-2);
    transform: translateY(140%);
    transition: transform .25s ease;
}
.pv-bar.is-visible { transform: none; }
/* Без цены в панели только кнопка — на всю ширину */
.pv-bar--no-price { padding-left: 8px; }
.pv-bar--no-price .pv-bar__btn { flex: 1; justify-content: center; }
.pv-bar__price { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; color: var(--tl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-bar__price small { font-size: 12px; font-weight: 500; color: var(--tl-ink-3); }
.pv-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: var(--tl-magenta);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- Полноэкранная галерея ---------- */
.fullscreen-carousel {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 7, 20, .96);
    cursor: pointer;
    animation: pv-fade .2s ease;
}
.fullscreen-carousel-container,
.fullscreen-carousel-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.fullscreen-carousel-inner { max-width: 1200px; }
.fullscreen-carousel-image { max-width: 100%; max-height: 100%; object-fit: contain; display: none; }
.fullscreen-carousel-image.active { display: block; }

.fullscreen-carousel-prev,
.fullscreen-carousel-next {
    position: absolute;
    top: 0;
    z-index: 10001;
    width: 40%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.fullscreen-carousel-prev { left: 0; }
.fullscreen-carousel-next { right: 0; }

.fullscreen-carousel-close {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 16px;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* ---------- Планшет ---------- */
@media (min-width: 640px) {
    .canvas_f.pv-page { padding-top: 56px; }
    .pv-layout { padding: 0 20px; }
    .pv-head, .pv-side, .pv-body { padding-left: 0; padding-right: 0; }
    .pv-gallery { margin-top: 18px; border-radius: var(--tl-r-l); }
    .pv-crumbs { display: flex; padding-left: 20px; padding-right: 20px; max-width: 640px; }
    .pv-crumbs + .pv-layout .pv-gallery { margin-top: 0; }
}

/* ---------- Десктоп: две колонки ---------- */
@media (min-width: 980px) {
    .pv-crumbs { max-width: 1160px; padding-left: 24px; padding-right: 24px; }

    .pv-layout {
        max-width: 1160px;
        padding: 0 24px;
        grid-template-columns: minmax(0, 1fr) 360px;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "gallery side"
            "head    side"
            "body    side";
        column-gap: 32px;
    }

    .pv-side { padding-top: 0; }
    .pv-card { position: sticky; top: 76px; }

    .carousel-postview { aspect-ratio: 16 / 10; max-height: 450px; }

    .pv-head { padding-top: 22px; }

    .pv-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-image.active, .comment, .fullscreen-carousel { animation: none; }
    .carousel-indicator::before, .pv-bar { transition: none; }
}

/* ---------- Панель автора на странице своего поста ---------- */
.pv-owner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 14px;
	background: var(--tl-surface-2);
}
.pv-owner__t { flex: 1 1 100%; font-size: 12.5px; color: var(--tl-ink-3); }
.pv-owner__btn, .pv-owner__btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 34px;
	padding: 0 12px;
	border-radius: 10px;
	background: var(--tl-surface);
	color: var(--tl-ink);
	font-size: 13.5px;
	font-weight: 600;
	box-shadow: var(--tl-shadow-1);
}
.pv-owner__btn--boost, .pv-owner__btn--boost:visited { background: var(--tl-grad); color: #fff; }
.pv-owner__btn:hover { filter: brightness(1.06); }

/* Подвал не прячется под нижней панелью «Позвонить» на телефоне */
@media (max-width: 899px) {
    body:has(#pv-bar) .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
