/* CityForge — общие стили публичной части. Цвета и шрифты — из токенов темы (--sf-*). */
.sf-skip { position: absolute; left: -9999px; }
.sf-skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--sf-bg); padding: 8px 12px; }

.tpl-header__inner { gap: 24px; flex-wrap: wrap; padding: 10px 0; }
.tpl-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; flex: 1; }
.tpl-nav a { color: var(--sf-text); text-decoration: none; font-weight: 600; padding: 4px 0; border-bottom: 2px solid transparent; }
.tpl-nav a:hover, .tpl-nav a[aria-current="page"] { border-bottom-color: var(--sf-primary); }
.tpl-search input { width: 200px; }
.tpl-footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tpl-footer__inner nav a { margin-left: 16px; color: var(--sf-muted); }

.tpl-urgent { background: var(--sf-primary); color: #fff; padding: 8px 0; }
.tpl-urgent a { color: #fff; }

.tpl-columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding: 32px 0; }
.tpl-content--narrow { max-width: 820px; padding: 32px 0; }
@media (max-width: 960px) { .tpl-columns { grid-template-columns: 1fr; } }

/* Карточки */
.tpl-feed { display: grid; gap: 20px; }
.tpl-feed .tpl-card { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.tpl-feed .tpl-card:not(:has(.tpl-card__img)) { grid-template-columns: 1fr; }
@media (max-width: 600px) { .tpl-feed .tpl-card { grid-template-columns: 1fr; } }
.tpl-card__img { display: block; overflow: hidden; border-radius: var(--sf-radius); background: var(--sf-surface); aspect-ratio: 16 / 10; }
.tpl-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.tpl-card:hover .tpl-card__img img { transform: scale(1.03); }
.tpl-card__meta { display: flex; gap: 10px; align-items: center; color: var(--sf-muted); font-size: .85rem; margin-bottom: 4px; }
.tpl-card__title { font-family: var(--sf-font-head); font-size: 1.15rem; line-height: 1.3; margin: 0; }
.tpl-card__title a { color: var(--sf-text); text-decoration: none; }
.tpl-card__title a:hover { color: var(--sf-primary); }
.tpl-card--big .tpl-card__title { font-size: 1.9rem; margin-top: 12px; }
.tpl-card--big .tpl-card__lead { color: var(--sf-muted); font-size: 1.05rem; margin: 8px 0 0; }
.tpl-badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; }
.tpl-badge--urgent { background: var(--sf-primary); color: #fff; }
.tpl-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; margin-top: 24px; }

/* Главная */
.tpl-home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding: 32px 0; }
@media (max-width: 960px) { .tpl-home { grid-template-columns: 1fr; } }
.tpl-home__section { padding: 16px 0 32px; border-top: 1px solid var(--sf-border); }
.tpl-home__section h2 a { color: var(--sf-text); text-decoration: none; }
.tpl-timeline { list-style: none; padding: 0; margin: 0; }
.tpl-timeline li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--sf-border); }
.tpl-timeline time { color: var(--sf-muted); font-size: .85rem; padding-top: 2px; }
.tpl-timeline a { color: var(--sf-text); text-decoration: none; }
.tpl-timeline a:hover { color: var(--sf-primary); }
.tpl-timeline .is-urgent a { font-weight: 700; }

/* Сайдбар */
.tpl-sidebar { display: grid; gap: 28px; align-content: start; }
.tpl-widget__title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sf-muted); margin: 0 0 12px; }
.tpl-widget__title a { color: inherit; text-decoration: none; }
.tpl-popular { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.tpl-popular a { color: var(--sf-text); text-decoration: none; }
.tpl-tags { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-tags a { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--sf-surface); border: 1px solid var(--sf-border); color: var(--sf-text); text-decoration: none; font-size: .9rem; }
.tpl-tags a:hover { border-color: var(--sf-primary); color: var(--sf-primary); }
.tpl-calendar__head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; }
.tpl-calendar__head a { text-decoration: none; font-size: 1.3rem; padding: 0 8px; }
.tpl-calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: .9rem; }
.tpl-calendar__grid b { color: var(--sf-muted); font-weight: 500; font-size: .75rem; padding: 4px 0; }
.tpl-calendar__grid a, .tpl-calendar__grid span { padding: 6px 0; border-radius: 6px; }
.tpl-calendar__grid a { color: var(--sf-text); background: var(--sf-surface); text-decoration: none; font-weight: 600; }
.tpl-calendar__grid a:hover, .tpl-calendar__grid a.is-current { background: var(--sf-primary); color: #fff; }
.tpl-calendar__grid .is-empty { color: var(--sf-muted); opacity: .5; }

/* Статья */
.tpl-crumbs { font-size: .9rem; color: var(--sf-muted); margin-bottom: 12px; }
.tpl-crumbs a { color: var(--sf-muted); }
.tpl-article__title { font-family: var(--sf-font-head); font-size: 2.3rem; line-height: 1.15; margin: 0 0 12px; }
@media (max-width: 600px) { .tpl-article__title { font-size: 1.7rem; } }
.tpl-article__meta { display: flex; gap: 16px; color: var(--sf-muted); font-size: .9rem; margin-bottom: 16px; }
.tpl-article__lead { font-size: 1.2rem; font-weight: 500; line-height: 1.5; }
.sf-prose { font-size: 1.08rem; line-height: 1.7; }
.sf-prose p { margin: 0 0 1.1em; }
.sf-prose h2, .sf-prose h3 { font-family: var(--sf-font-head); margin: 1.6em 0 .6em; line-height: 1.25; }
.sf-prose ul, .sf-prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.sf-prose li { margin-bottom: .4em; }
.sf-figure { margin: 1.4em 0; }
.sf-figure img { border-radius: var(--sf-radius); display: block; width: 100%; }
.sf-figure figcaption, .sf-video figcaption { color: var(--sf-muted); font-size: .9rem; margin-top: 8px; }
.sf-source { opacity: .8; }
.sf-quote { margin: 1.6em 0; padding: 8px 0 8px 24px; border-left: 4px solid var(--sf-primary); font-size: 1.15em; font-style: italic; }
.sf-quote p { margin: 0; }
.sf-quote cite { display: block; margin-top: 8px; font-size: .85em; font-style: normal; color: var(--sf-muted); }
.sf-quote cite::before { content: '— '; }
.sf-divider { border: 0; text-align: center; margin: 2em 0; }
.sf-divider::after { content: '* * *'; color: var(--sf-muted); letter-spacing: .5em; }
.sf-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 1.4em 0; }
.sf-gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: calc(var(--sf-radius) / 2); }
.sf-gallery img { width: 100%; height: 100%; object-fit: cover; }
.sf-gallery[data-count="1"] { grid-template-columns: 1fr; }
.sf-gallery[data-count="2"] { grid-template-columns: 1fr 1fr; }
.sf-video { margin: 1.4em 0; }
.sf-video__frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--sf-radius); overflow: hidden; }
.sf-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sf-embed { margin: 1.4em 0; overflow-x: auto; }
.tpl-share { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--sf-border); border-bottom: 1px solid var(--sf-border); margin: 24px 0; }
.tpl-related { margin-top: 32px; }

/* Пагинация */
.sf-pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 32px 0; }
.sf-pager a, .sf-pager span { min-width: 40px; text-align: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--sf-border); text-decoration: none; color: var(--sf-text); }
.sf-pager .is-current { background: var(--sf-primary); border-color: var(--sf-primary); color: #fff; }

/* Просмотр фото */
.sf-lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-items: center; z-index: 1000; padding: 24px; cursor: zoom-out; }
.sf-lightbox img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; }
.sf-lightbox figcaption { color: #ddd; text-align: center; margin-top: 12px; }
.sf-lightbox button { position: absolute; top: 50%; background: rgba(255, 255, 255, .12); color: #fff; border: 0; font-size: 2rem; width: 48px; height: 64px; cursor: pointer; border-radius: 8px; }
.sf-lightbox .prev { left: 12px; } .sf-lightbox .next { right: 12px; }

/* Кабинет, вход, комментарии */
.tpl-account { font-weight: 600; text-decoration: none; white-space: nowrap; }
.tpl-flash { margin-top: 16px; }
.tpl-auth { display: grid; place-items: center; padding: 40px 0; }
.tpl-auth .sf-card { width: min(440px, 100%); }
.tpl-auth__links { margin: 16px 0 0; font-size: .95rem; }
.tpl-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tpl-social__or { display: flex; align-items: center; gap: 12px; color: var(--sf-muted); margin: 20px 0 12px; }
.tpl-social__or::before, .tpl-social__or::after { content: ''; flex: 1; border-top: 1px solid var(--sf-border); }
.tpl-social__buttons { display: grid; gap: 8px; }
.tpl-social__btn { justify-content: center; }
.tpl-social__btn--vk { border-color: #0077ff; color: #0077ff; }
.tpl-social__btn--yandex { border-color: #fc3f1d; color: #fc3f1d; }
.tpl-social__btn--telegram { border-color: #229ed9; color: #229ed9; }
.tpl-social__note { font-size: .8rem; margin-top: 10px; }
.tpl-cabinet { padding: 32px 0; }
.tpl-cabinet-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--sf-border); margin-bottom: 20px; padding-bottom: 8px; }
.tpl-cabinet-nav a { text-decoration: none; color: var(--sf-text); font-weight: 600; padding: 6px 0; }
.tpl-cabinet-nav a[aria-current="page"] { color: var(--sf-primary); box-shadow: inset 0 -2px 0 var(--sf-primary); }
.tpl-cabinet-nav form { margin-left: auto; }
.tpl-avatar-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tpl-avatar { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--sf-border); }
.tpl-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tpl-socials-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tpl-socials-list li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sf-inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.sf-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tpl-comments { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--sf-border); }
.tpl-comment { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--sf-border); }
.tpl-comment--reply { margin-left: 56px; grid-template-columns: 36px 1fr; }
.tpl-comment:target { background: color-mix(in srgb, var(--sf-primary) 7%, transparent); }
.tpl-comment__avatar { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--sf-border); display: grid; place-items: center; font-weight: 700; color: var(--sf-muted); }
.tpl-comment__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tpl-comment__meta { font-size: .9rem; margin-bottom: 4px; }
.tpl-comment__meta a { text-decoration: none; }
.tpl-comment__staff { font-size: .72rem; background: var(--sf-primary); color: #fff; border-radius: 4px; padding: 1px 6px; }
.tpl-comment__pending { font-size: .8rem; color: var(--sf-warn); }
.tpl-comment__text { overflow-wrap: anywhere; }
.tpl-comment__actions { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; font-size: .9rem; }
.tpl-comment__actions .btn { padding: 2px 8px; font-weight: 500; }
.tpl-reply summary { cursor: pointer; color: var(--sf-primary); }
.tpl-reply form { margin-top: 8px; }
.tpl-comment-form { margin-top: 16px; }

/* Справочник */
.tpl-catalog, .tpl-org-page { padding: 24px 0 40px; }
.tpl-catalog__search { margin: 8px 0 20px; }
.tpl-catalog__search input { flex: 1; min-width: 220px; }
.tpl-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.tpl-cat { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--sf-radius); background: var(--sf-surface); border: 1px solid var(--sf-border); color: var(--sf-text); text-decoration: none; }
.tpl-cat:hover { border-color: var(--sf-primary); }
.tpl-cat__icon { font-size: 1.6rem; }
.tpl-cat__name { font-weight: 600; }
.tpl-tags a[aria-current="page"] { background: var(--sf-primary); color: #fff; border-color: var(--sf-primary); }
.tpl-catalog__layout.has-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 42%); gap: 28px; align-items: start; }
@media (max-width: 960px) { .tpl-catalog__layout.has-map { grid-template-columns: 1fr; } .tpl-catalog__map { order: -1; } }
.tpl-catalog__map { position: sticky; top: 16px; }
.tpl-orgs { display: grid; gap: 12px; }
.tpl-org { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 14px; border-radius: var(--sf-radius); border: 1px solid var(--sf-border); background: var(--sf-bg); }
.tpl-org.is-priority { border-color: var(--sf-accent); box-shadow: 0 0 0 1px var(--sf-accent); }
.tpl-org__logo { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--sf-surface); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; color: var(--sf-muted); text-decoration: none; }
.tpl-org__logo img { width: 100%; height: 100%; object-fit: cover; }
.tpl-org__logo--big { width: 120px; height: 120px; }
.tpl-org__name { margin: 0 0 4px; font-size: 1.1rem; }
.tpl-org__name a { color: var(--sf-text); text-decoration: none; }
.tpl-org__name a:hover { color: var(--sf-primary); }
.tpl-org__short { margin: 0 0 6px; color: var(--sf-muted); }
.tpl-org__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; align-items: center; }
.tpl-badge--priority { background: var(--sf-accent); color: #fff; margin-left: 6px; vertical-align: middle; }
.tpl-rating { font-weight: 700; color: #e8a400; text-decoration: none; }
.tpl-hours.is-open { color: var(--sf-ok); }
.tpl-hours.is-closed { color: var(--sf-muted); }
.tpl-org-head { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; margin-bottom: 24px; }
@media (max-width: 600px) { .tpl-org-head { grid-template-columns: 1fr; } }
.tpl-org-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .tpl-org-grid { grid-template-columns: 1fr; } }
.tpl-org-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.tpl-org-side p { margin: 0 0 12px; }
.tpl-org-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--sf-border); }
.tpl-socials-links a { margin-right: 10px; }
.tpl-review { padding: 14px 0; border-bottom: 1px solid var(--sf-border); }
.tpl-review__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tpl-review p { margin: 6px 0 0; overflow-wrap: anywhere; }
.tpl-review__reply { margin: 10px 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--sf-primary); background: var(--sf-surface); border-radius: 0 8px 8px 0; }
.tpl-stars { color: #e8a400; letter-spacing: 1px; }
.tpl-stars__off { color: var(--sf-border); }
.tpl-review-form { margin-top: 16px; }
.tpl-review-form summary, .tpl-claim summary { cursor: pointer; font-weight: 600; color: var(--sf-primary); }
.tpl-stars-input { border: 0; padding: 0; display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.tpl-stars-input legend { float: left; margin-right: 8px; }
.tpl-stars-input input { position: absolute; opacity: 0; width: 1px; }
.tpl-stars-input label { font-size: 1.8rem; color: var(--sf-border); cursor: pointer; display: inline !important; }
.tpl-stars-input input:checked ~ label, .tpl-stars-input label:hover, .tpl-stars-input label:hover ~ label { color: #e8a400; }
.tpl-stars-input input:focus-visible + label { outline: 2px solid var(--sf-primary); }
.tpl-hours-grid th { text-align: left; padding-right: 12px; font-weight: 500; }
.tpl-hours-grid td { padding: 2px 6px 2px 0; }
.tpl-owner-org { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tpl-org-link { font-weight: 600; }

/* Карта */
.sf-map { position: relative; height: 520px; border-radius: var(--sf-radius); overflow: hidden; background: var(--sf-surface); border: 1px solid var(--sf-border); }
.sf-map--small { height: 260px; }
.sf-map--picker { height: 360px; margin-bottom: 10px; }
.sf-map__canvas { position: absolute; inset: 0; }
.sf-map.is-error { display: grid; place-items: center; color: var(--sf-muted); }
.sf-pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: var(--sf-primary); transform: translate(-50%, -100%) rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); cursor: pointer; }
.sf-pin--priority { background: var(--sf-accent); width: 28px; height: 28px; }
.sf-map__card { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; background: var(--sf-bg); border-radius: 10px; padding: 12px 36px 12px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.sf-map__title { font-weight: 700; text-decoration: none; }
.sf-map__close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--sf-muted); }

/* Доска объявлений */
.tpl-board, .tpl-ad-page { padding: 24px 0 40px; }
.tpl-board__total { font-size: 1rem; font-weight: 400; }
.tpl-board__search { margin: 8px 0 20px; }
.tpl-board__search input { flex: 1; min-width: 220px; }
.tpl-board__layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .tpl-board__layout { grid-template-columns: 1fr; } .tpl-board__filters details, .tpl-board__filters { order: -1; } }
.tpl-board__filters .sf-card { display: grid; gap: 12px; }
.tpl-board__filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.tpl-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tpl-ads--row { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tpl-ad { position: relative; display: flex; flex-direction: column; border-radius: var(--sf-radius); background: var(--sf-bg); border: 1px solid var(--sf-border); overflow: hidden; }
.tpl-ad.is-highlight { background: color-mix(in srgb, var(--sf-accent) 9%, var(--sf-bg)); border-color: var(--sf-accent); }
.tpl-ad.is-gone { opacity: .6; }
.tpl-ad__photo { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--sf-surface); }
.tpl-ad__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-ad__nophoto { display: grid; place-items: center; height: 100%; color: var(--sf-muted); font-size: .9rem; }
.tpl-ad__count { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; }
.tpl-ad__body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.tpl-ad__title { margin: 0; font-size: 1rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-ad__title a { color: var(--sf-text); text-decoration: none; }
.tpl-ad__title a::after { content: ""; position: absolute; inset: 0; }
.tpl-ad__title a:hover { color: var(--sf-primary); }
.tpl-ad__price { font-weight: 700; font-size: 1.05rem; }
.tpl-ad__meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .82rem; }
.tpl-ad__fav { position: absolute; top: 8px; right: 8px; z-index: 2; margin: 0; }
.tpl-fav { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: #b9bcc4; font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; text-decoration: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.tpl-fav:hover, .tpl-fav.is-on { color: #e5384f; }
.tpl-fav-btn.is-on { color: #e5384f; }
.tpl-ad-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .tpl-ad-grid { grid-template-columns: 1fr; } }
.tpl-ad-page__title { margin-bottom: 4px; overflow-wrap: anywhere; }
.tpl-ad-page__sub { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; margin-bottom: 16px; }
.tpl-ad-page__price { font-size: 1.7rem; font-weight: 800; margin-bottom: 12px; }
.tpl-ad-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; border-radius: var(--sf-radius); background: var(--sf-surface); }
.tpl-ad-gallery__item { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.tpl-ad-gallery__item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tpl-ad-thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.tpl-ad-thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; display: block; }
.tpl-ad-section { margin-top: 24px; }
.tpl-ad-body { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.tpl-ad-params { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin-top: 16px; }
.tpl-ad-params dt { color: var(--sf-muted); }
.tpl-ad-params dd { margin: 0; }
.tpl-ad-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.tpl-ad-side .sf-card { display: grid; gap: 12px; }
.tpl-phone { width: 100%; justify-content: center; flex-direction: column; font-size: 1.05rem; }
.tpl-phone__mask { display: block; font-size: .85rem; opacity: .85; font-weight: 400; }
.tpl-ad-safety { font-size: .82rem; margin: 0; }
.tpl-seller { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--sf-border); }
.tpl-my-ads { display: grid; gap: 12px; }
.tpl-my-ad { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
@media (max-width: 760px) { .tpl-my-ad { grid-template-columns: 90px 1fr; } .tpl-my-ad__actions { grid-column: 1 / -1; } }
.tpl-my-ad__photo { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--sf-surface); display: block; }
.tpl-my-ad__photo img { width: 100%; height: 100%; object-fit: cover; }
.tpl-my-ad__info { display: grid; gap: 4px; min-width: 0; }
.tpl-my-ad__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.sf-inline-form { display: inline; margin: 0; }
.sf-field-error { display: block; color: var(--sf-danger, #c62828); font-size: .85rem; margin-top: 4px; }
.tpl-ad-form fieldset { margin-bottom: 18px; }
[hidden] { display: none !important; }

/* Афиша */
.tpl-afisha, .tpl-event-page { padding: 24px 0 40px; }
.tpl-periods { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.tpl-periods a { padding: 7px 16px; border-radius: 20px; border: 1px solid var(--sf-border); color: var(--sf-text); text-decoration: none; }
.tpl-periods a[aria-current="page"] { background: var(--sf-primary); border-color: var(--sf-primary); color: #fff; }
.tpl-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: thin; }
.tpl-day { flex: 0 0 48px; display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; color: var(--sf-text); text-decoration: none; border: 1px solid transparent; }
.tpl-day:hover { border-color: var(--sf-border); }
.tpl-day__dow { font-size: .75rem; color: var(--sf-muted); }
.tpl-day b { font-size: 1.15rem; }
.tpl-day.is-weekend b, .tpl-day.is-weekend .tpl-day__dow { color: #d33a4b; }
.tpl-day.is-empty { opacity: .45; }
.tpl-day[aria-current="page"] { background: var(--sf-primary); }
.tpl-day[aria-current="page"] b, .tpl-day[aria-current="page"] .tpl-day__dow { color: #fff; }
.tpl-afisha__filters { display: grid; gap: 10px; margin-bottom: 18px; }
.tpl-afisha__filters .sf-form--inline input[type="search"] { flex: 1; min-width: 200px; }
.tpl-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px 16px; }
.tpl-events--row { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tpl-event { position: relative; display: flex; flex-direction: column; gap: 8px; }
.tpl-event__poster { position: relative; display: block; text-decoration: none; aspect-ratio: 3 / 4; border-radius: var(--sf-radius); overflow: hidden; background: var(--sf-surface); }
.tpl-event__poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.tpl-event:hover .tpl-event__poster img { transform: scale(1.03); }
.tpl-event__noposter { display: grid; place-items: center; height: 100%; font-size: 3rem; color: var(--sf-muted); }
.tpl-event__age { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .78rem; font-weight: 700; }
.tpl-event__pick { position: absolute; left: 8px; bottom: 8px; margin: 0; }
.tpl-event.is-featured .tpl-event__poster { box-shadow: 0 0 0 3px var(--sf-accent); }
.tpl-event__when { font-size: .85rem; font-weight: 600; color: var(--sf-primary); }
.tpl-event__title { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.tpl-event__title a { color: var(--sf-text); text-decoration: none; }
.tpl-event__title a::after { content: ""; position: absolute; inset: 0; }
.tpl-event__title a:hover { color: var(--sf-primary); }
.tpl-event__meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .85rem; }
.tpl-event__price { color: var(--sf-text); font-weight: 600; }
.tpl-event-head { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 28px; }
@media (max-width: 760px) { .tpl-event-head { grid-template-columns: 1fr; } .tpl-event-head__poster { max-width: 360px; } }
.tpl-event-head__poster { aspect-ratio: 3 / 4; border-radius: var(--sf-radius); overflow: hidden; background: var(--sf-surface); }
.tpl-event-head__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-event-head__info .sf-h1 { margin: 6px 0 10px; overflow-wrap: anywhere; }
.tpl-age { display: inline-block; padding: 0 6px; border: 1px solid currentColor; border-radius: 4px; font-weight: 700; font-size: .8rem; }
.tpl-event-next { font-size: 1.1rem; }
.tpl-event-actions { align-items: center; gap: 10px; margin-top: 12px; }
.tpl-event-price { font-size: 1.3rem; font-weight: 800; margin-right: 6px; }
.tpl-event-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .tpl-event-grid { grid-template-columns: 1fr; } }
.tpl-event-section { margin-bottom: 28px; }
.tpl-event-body p { line-height: 1.65; overflow-wrap: anywhere; }
.tpl-event-side { position: sticky; top: 16px; }
.tpl-sessions { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.tpl-sessions dt { font-weight: 600; }
.tpl-sessions dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-session { padding: 3px 10px; border-radius: 8px; background: var(--sf-surface); border: 1px solid var(--sf-border); font-variant-numeric: tabular-nums; }
.tpl-session small { color: var(--sf-muted); }
.tpl-sessions-edit { display: grid; gap: 6px; margin-bottom: 8px; }
.tpl-sessions-edit__head, .tpl-sessions-edit__row { display: grid; grid-template-columns: 150px 110px 150px 110px minmax(120px, 1fr); gap: 6px; }
.tpl-sessions-edit__head { font-size: .8rem; color: var(--sf-muted); }
@media (max-width: 760px) { .tpl-sessions-edit__head { display: none; } .tpl-sessions-edit__row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--sf-border); } .tpl-sessions-edit__row input:last-child { grid-column: 1 / -1; } }
.tpl-event-form__grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; }
@media (max-width: 760px) { .tpl-event-form__grid { grid-template-columns: 1fr; } }

/* Баннеры */
.sf-bn-zone { display: grid; gap: 12px; justify-items: center; }
.tpl-bn-header { padding-top: 12px; }
.tpl-bn-footer { padding: 8px 0 24px; }
.tpl-home__section--banners { padding-top: 8px; padding-bottom: 8px; }
.sf-bn { position: relative; max-width: 100%; line-height: 0; }
.sf-bn img { max-width: 100%; height: auto; display: block; border-radius: 8px; }
.sf-bn__frame { border: 0; display: block; }
.sf-bn__label { position: absolute; top: 6px; right: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; line-height: 1.4; cursor: default; }
.sf-bn__info { display: none; }
.sf-bn__label:hover .sf-bn__info, .sf-bn__label:focus-within .sf-bn__info { display: inline; }
.sf-bn__label:hover .sf-bn__info::before { content: ". "; }
@media (max-width: 767px) { .sf-bn--desktop { display: none; } }
@media (min-width: 768px) { .sf-bn--mobile { display: none; } }
.tpl-ad-side .sf-bn-zone, .tpl-event-side .sf-bn-zone, .tpl-org-side .sf-bn-zone { margin-top: 16px; }
.tpl-bn-public-report { padding: 24px 0 40px; max-width: 900px; }
.tpl-bn-totals { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.tpl-bn-totals div { padding: 12px 18px; border-radius: var(--sf-radius); background: var(--sf-surface); display: grid; gap: 2px; min-width: 140px; }
.tpl-bn-totals span { color: var(--sf-muted); font-size: .85rem; }
.tpl-bn-totals b { font-size: 1.5rem; }
.tpl-bn-stats td { position: relative; }
.tpl-bn-bar { display: inline-block; height: 8px; width: var(--w); max-width: 60%; min-width: 2px; margin-right: 8px; border-radius: 4px; background: var(--sf-primary); vertical-align: middle; }

/* Погода */
.tpl-weather-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 16px; color: inherit; text-decoration: none; font-weight: 600; white-space: nowrap; }
.tpl-weather-badge:hover { background: var(--sf-surface); }
.tpl-weather { padding: 24px 0 40px; }
.tpl-weather-alert { padding: 10px 14px; border-radius: var(--sf-radius); margin-bottom: 10px; border-left: 5px solid; }
.tpl-weather-alert--1 { background: #fff8db; border-color: #e8b500; }
.tpl-weather-alert--2 { background: #ffe8d6; border-color: #f07800; }
.tpl-weather-alert--3 { background: #ffe0e0; border-color: #d32f2f; }
.tpl-weather-now { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.tpl-weather-now__main { display: flex; align-items: center; gap: 14px; }
.tpl-weather-now__icon { font-size: 3rem; line-height: 1; }
.tpl-weather-now__temp { font-size: 3.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tpl-weather-now__text { font-size: 1.15rem; font-weight: 600; }
.tpl-weather-now__details { display: grid; grid-template-columns: repeat(2, minmax(160px, auto)); gap: 8px 24px; margin: 0; }
.tpl-weather-now__details dt { color: var(--sf-muted); font-size: .85rem; }
.tpl-weather-now__details dd { margin: 0; }
.tpl-weather-section { margin-top: 24px; }
.tpl-weather-hours { display: flex; gap: 6px; overflow-x: auto; list-style: none; padding: 0 0 6px; margin: 0; scrollbar-width: thin; }
.tpl-weather-hours li { flex: 0 0 64px; display: grid; justify-items: center; gap: 4px; padding: 10px 0; border-radius: 10px; background: var(--sf-surface); font-variant-numeric: tabular-nums; }
.tpl-weather-hours__icon { font-size: 1.4rem; }
.tpl-weather-pop { font-size: .75rem; color: #2a6fb3; }
.tpl-weather-days td { vertical-align: middle; }
.tpl-weather-days__icon { font-size: 1.3rem; }
.tpl-weather-days tr.is-weekend td:first-child { color: #d33a4b; }
@media (max-width: 600px) { .sf-hide-sm { display: none; } .tpl-weather-now__details { grid-template-columns: 1fr 1fr; } }
.tpl-weather-source { font-size: .82rem; margin-top: 16px; }
.tpl-weather-home { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; color: inherit; text-decoration: none; }
.tpl-weather-home:hover { border-color: var(--sf-primary); }
.tpl-weather-home__now { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.tpl-weather-home__now .tpl-weather-now__temp { font-size: 2.4rem; }
.tpl-weather-home__now .tpl-weather-now__icon { font-size: 2.2rem; }
.tpl-weather-home__day { display: grid; justify-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.tpl-weather-home__alert { flex-basis: 100%; color: #b25b00; font-weight: 600; }

/* Переключатель темы */
.tpl-mode { border: 1px solid var(--sf-border); background: var(--sf-bg); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; padding: 0; line-height: 1; font-size: 1rem; }
.tpl-mode:hover { border-color: var(--sf-primary); }
.tpl-mode__dark { display: none; }
.tpl-mode[aria-pressed="true"] .tpl-mode__light { display: none; }
.tpl-mode[aria-pressed="true"] .tpl-mode__dark { display: inline; }
.tpl-bn-header .sf-bn img, .tpl-bn-footer .sf-bn img { max-height: 250px; object-fit: cover; }
.tpl-bn-header .sf-bn, .tpl-bn-footer .sf-bn { width: 100%; }

/* Единый поиск */
.tpl-find { padding: 24px 0 40px; max-width: 860px; }
.tpl-find__form { display: flex; gap: 10px; margin-bottom: 18px; }
.tpl-find__form input { flex: 1; font-size: 1.05rem; padding: 12px 16px; }
.tpl-find__group { margin-top: 24px; }
.tpl-find__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.tpl-find__list a { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 8px; border-radius: var(--sf-radius); color: var(--sf-text); text-decoration: none; }
.tpl-find__list a:hover { background: var(--sf-surface); }
.tpl-find__list small { display: block; color: var(--sf-muted); margin-top: 2px; }
.tpl-find__img { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--sf-surface); }
.tpl-find__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-find__empty { padding: 24px; border-radius: var(--sf-radius); background: var(--sf-surface); }

/* Полоса демо-сайта облака */
.cf-demo { background: #141a2a; color: #fff; text-align: center; font-size: .9rem; padding: 8px 16px; }
.cf-demo a { color: #ffb020; font-weight: 600; margin-left: 8px; }
