/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */


header{
  box-shadow: var(--shadow-sm);
}

/* Chat messages area background (Telegram light) */
.chat-messages {
  background-color: #e7ebf0;
  background-image: radial-gradient(#dfe3e8 1px, transparent 1px);
  background-size: 20px 20px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: #c1c1c1;
  border-radius: 3px;
}

/* Message row */
.chat-message {
  display: flex;
  width: 100%;
  margin-bottom: 2px;
  animation: chat-fade-in-up 150ms ease-out;
}

.chat-message.group-last {
  margin-bottom: 10px;
}

.chat-message-inner {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

/* Avatar column for others */
.chat-message-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #74c0fc, #339af0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
  margin-right: 0.5rem;
  align-self: flex-end;
}

.chat-message-avatar.hidden {
  display: none;
}

/* Author name */
.chat-author-name {
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 2px;
  margin-left: 0.75rem;
}

/* Bubble base */
.chat-bubble {
  position: relative;
  padding: 0.375rem 0.625rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  word-break: break-word;
  border-radius: 1rem;
}

.chat-bubble-text {
  font-size: 0.9375rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.chat-message-own {
  justify-content: flex-end;
}

.chat-message-own .chat-message-inner {
  align-items: flex-end;
}

.chat-message-own .chat-bubble {
  background-color: #eeffde;
  color: #000000;
  border-bottom-right-radius: 0.375rem;
}

.chat-message-own.group-last .chat-bubble {
  border-bottom-right-radius: 0.25rem;
}

.chat-message-own .chat-reply {
  border-left-color: #86c755;
  color: #5c8a3c;
}

.chat-message-own .chat-time {
  color: #5c8a3c;
}

.chat-message-other {
  justify-content: flex-start;
}

.chat-message-other .chat-message-inner {
  align-items: flex-start;
}

.chat-message-other .chat-bubble {
  background-color: #ffffff;
  color: #000000;
  border-bottom-left-radius: 0.375rem;
}

.chat-message-other.group-last .chat-bubble {
  border-bottom-left-radius: 0.25rem;
}

.chat-message-other .chat-reply {
  border-left-color: #9ca3af;
  color: #6b7280;
}

.chat-message-other .chat-time {
  color: #9ca3af;
}

.chat-message-own .chat-message-avatar,
.chat-message-own .chat-author-name {
  display: none;
}

.chat-message-other .conversation-read-check {
  display: none;
}

/* Reply quote */
.chat-reply {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
  border-left-width: 2px;
}

/* Time */
.chat-time {
  font-size: 11px;
  line-height: 1;
  margin-left: 0.5rem;
  float: right;
  margin-top: 0.25rem;
}

/* Date separator pill */
.chat-date-separator {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.chat-date-separator span {
  background-color: rgba(255, 255, 255, 0.8);
  color: #6b7280;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Chat header */
.chat-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  transition: box-shadow 0.2s ease;
}

.chat-header.scrolled {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Input area */
.chat-input-wrapper {
  background-color: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
}

.chat-send-button {
  background-color: #3b82f6;
  color: #ffffff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.chat-send-button:hover {
  background-color: #2563eb;
}

@keyframes chat-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Private conversation (messages/:id)
   ========================================================================== */

.conversation-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--header-h));
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 639px) {
  .conversation-page {
    padding-top: var(--header-h);
  }
}

.conversation-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.conversation-header {
  flex-shrink: 0;
}

.conversation-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #74c0fc, #339af0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
}

.conversation-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #f9fafb;
  display: flex;
  flex-direction: column;
}

.conversation-empty-state {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6b7280;
  font-size: 0.9375rem;
  padding: 2rem;
}

.conversation-form {
  flex-shrink: 0;
}

.conversation-read-check {
  color: #4b8df8;
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

.chat-system-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  color: #6b7280;
  font-size: 0.8125rem;
}

.chat-system-message-text {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.chat-system-message-time {
  font-size: 0.6875rem;
  color: #9ca3af;
}

.conversation-send-button {
  background-color: #CF0234 !important;
}

.conversation-send-button:hover {
  background-color: #a6022a !important;
}

/* Hide mobile tab bar and footer inside conversation page */
.conversation-page ~ .mobile-tab-bar,
.conversation-page ~ footer {
  display: none;
}

/* ==========================================================================
   Design System
   ========================================================================== */

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-surface: #ffffff;
  --color-background: #f9fafb;
  --color-text: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #9ca3af;
  --color-border: #e5e7eb;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --header-height: 3.5rem;
  --header-h: var(--header-height);
  --tab-bar-height: 0px;
}

@media (max-width: 799px) {
  :root {
    --tab-bar-height: 3.5rem;
  }
}

/* Hide scrollbar while preserving scroll functionality */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Offset for smooth scroll and native validation bubble under fixed header */
html {
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

form[data-controller~="form-validation"] input,
form[data-controller~="form-validation"] select,
form[data-controller~="form-validation"] textarea,
form[data-controller~="form-validation"] [data-form-validation-target="map"],
form[data-controller~="form-validation"] [data-form-validation-target="attachment"] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Typography scale */
.ds-h1 {
  font-size: 1.5rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.ds-h2 {
  font-size: 1.25rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.ds-h3 {
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.ds-body {
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--color-text-secondary);
}

.ds-small {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-text-muted);
}

.ds-xs {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-text-muted);
}

/* Cards */
.ds-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ds-card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Map containers (forms, show pages, district map) */
.map-container {
  border-radius: 6px;
  overflow: hidden;
}

/* Form inputs: unified border-radius */
.form-input {
  border-radius: 6px;
}

/* Brand colors (KlikTuk red) */
.bg-brand {
  background-color: #CF0234 !important;
}
.bg-brand-hover:hover {
  background-color: #b8022e !important;
}
.focus-ring-brand:focus {
  outline: none;
  --tw-ring-color: #CF0234;
  --tw-ring-offset-width: 2px;
  box-shadow: 0 0 0 var(--tw-ring-width, 2px) var(--tw-ring-color), 0 0 0 calc(var(--tw-ring-width, 2px) + var(--tw-ring-offset-width, 2px)) var(--tw-ring-offset-color, white);
}

/* Buttons */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  cursor: pointer;
}

.ds-btn:active {
  transform: scale(0.97);
}

.ds-btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

.ds-btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.ds-btn-secondary {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.ds-btn-secondary:hover {
  background-color: #dbeafe;
}

.ds-btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
}

.ds-btn-ghost:hover {
  background-color: #f3f4f6;
  color: var(--color-text);
}

/* Chips */
.ds-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ds-chip:hover {
  background-color: #e5e7eb;
  /*color: var(--color-text);*/
}

.ds-chip-active {
  background-color: var(--color-primary);
  color: #ffffff;
}

.ds-chip-active:hover {
  background-color: var(--color-primary-hover);
}

@media not all and (min-width: 800px) {
  .place-category-chip svg,
  .place-category-chip-add-action svg {
    width: 14px;
    height: 14px;
  }
}

/* Rating stars */
.ds-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  color: #f59e0b;
}

.ds-rating-value {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

/* Avatar */
.ds-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
}

img.ds-avatar {
  background: transparent;
}

.ds-avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
}

.ds-avatar-md {
  width: 3rem;
  height: 3rem;
  font-size: 0.875rem;
}

.ds-avatar-lg {
  width: 8rem;
  height: 8rem;
  font-size: 1.5rem;
}

.ds-avatar.w-24.h-24 {
  width: 6rem;
  height: 6rem;
  font-size: 1.5rem;
}

/* Filter bar */
.ds-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.25rem;
}

.ds-filter-bar::-webkit-scrollbar {
  display: none;
}

/* Section title */
.ds-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ds-section-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
}

.ds-section-link:hover {
  color: var(--color-primary-hover);
}

/* Empty state */
.ds-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border);
}

.ds-empty-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.ds-empty-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.mb-head-menu{

}
@media (max-width: 800px) {
  .mb-head-menu {
    display: none;
  }
}

/* Mobile bottom tab bar */
.mobile-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 800px) {
  .mobile-tab-bar {
    display: none;
  }
}

.mobile-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.375rem 0;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.mobile-tab-item.active {
  color: var(--color-primary);
}

/* PWA install banner */
.pwa-install-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
}

@media (max-width: 639px) {
  .pwa-install-banner {
    bottom: calc(3.5rem + env(safe-area-inset-bottom) + -4px);
  }
  .pwa-install-banner .pwa_inl_crd{
    flex-wrap: wrap;
    justify-content: center;
  }
}

.pwa-install-banner__card {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
}

@media (max-width: 639px) {
  .conv_usl_bl{
    flex-wrap: wrap;
    gap: 0;
    display: block;
  }
}

/* Status badges */
.ds-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.ds-badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.ds-badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.ds-badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Search input */
.ds-search {
  position: relative;
  width: 100%;
  height: 52px;
  background-color: var(--color-surface);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ds-search-submit {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.ds-search-submit:hover {
  color: var(--color-primary);
  background-color: #f3f4f6;
}

.ds-search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.ds-search-clear:hover {
  color: #6b7280;
  background-color: #f3f4f6;
}

.ds-search-clear.hidden {
  display: none;
}

.ds-search input {
  width: 100%;
  height: 100%;
  padding-left: 52px;
  padding-right: 44px;
  background: transparent;
  border: none;
  border-radius: 6px;
  outline: none;
  font-size: 1rem;
  color: var(--color-text);
}

.ds-search input::placeholder {
  color: #9ca3af;
}

/* App layout helpers */
.app-main {
  padding-top: calc(var(--header-height) + 1rem);
  padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
  .app-main {
    padding-top: calc(var(--header-height) + 1rem);
    padding-bottom: 1rem;
  }
}

/* ==========================================================================
   Places catalog
   ========================================================================== */

.category-grid-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumbs li {
  flex-shrink: 0;
}

.review-bar-fill {
  transition: width 0.3s ease;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.9);
  padding: 1rem;
}

.lightbox-overlay.hidden {
  display: none;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 9999px;
  font-size: 1.5rem;
  color: #1f2937;
  cursor: pointer;
  border: none;
  z-index: 101;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 9999px;
  color: #1f2937;
  cursor: pointer;
  border: none;
  z-index: 101;
}

.lightbox-nav-prev {
  left: 1rem;
}

.lightbox-nav-next {
  right: 1rem;
}

.lightbox-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.375rem 0.875rem;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border-radius: 9999px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  z-index: 101;
}

@media (max-width: 640px) {
  .lightbox-nav {
    width: 2rem;
    height: 2rem;
  }

  .lightbox-nav-prev {
    left: 0.5rem;
  }

  .lightbox-nav-next {
    right: 0.5rem;
  }
}

/* ==========================================================================
   Place gallery mosaic
   ========================================================================== */

/* Общая мозаичная галерея: места, объявления, события, новости */
.gallery-mosaic {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery-mosaic::-webkit-scrollbar {
  display: none;
}

.gallery-mosaic__tile {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.5rem;
  background-color: #e5e7eb;
  scroll-snap-align: start;
}

.gallery-mosaic__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-mosaic__overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
}

.gallery-mosaic__counter {
  position: absolute;
  top: 1rem;
  right: 1rem;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  z-index: 10;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .gallery-mosaic {
    display: grid;
    overflow: hidden;
    grid-template-columns: none;
    grid-template-rows: none;
    grid-auto-columns: auto;
    grid-auto-flow: initial;
    height: auto;
  }

  .gallery-mosaic__tile,
  .gallery-mosaic__tile--0,
  .gallery-mosaic__tile:not(.gallery-mosaic__tile--0) {
    flex: none;
    scroll-snap-align: none;
    width: auto;
    height: auto;
    aspect-ratio: auto;
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-mosaic .gallery-mosaic__overlay {
    display: flex;
  }

  /* Hide tiles beyond visible count for 4 and 5+ layouts */
  .gallery-mosaic--4 .gallery-mosaic__tile:nth-child(n+4),
  .gallery-mosaic--5plus .gallery-mosaic__tile:nth-child(n+6) {
    display: none;
  }

  /* 1 photo */
  .gallery-mosaic--1 {
    grid-template-columns: 1fr;
    max-height: 480px;
  }

  .gallery-mosaic--1 .gallery-mosaic__tile {
    max-height: 480px;
  }

  /* 2 photos */
  .gallery-mosaic--2 {
    grid-template-columns: repeat(2, 1fr);
    height: 420px;
  }

  /* 3 photos */
  .gallery-mosaic--3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: 420px;
  }

  .gallery-mosaic--3 .gallery-mosaic__tile--0 {
    grid-column: span 2;
    grid-row: span 2;
  }

  /* 4 photos */
  .gallery-mosaic--4 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: 420px;
  }

  .gallery-mosaic--4 .gallery-mosaic__tile--0 {
    grid-column: span 2;
    grid-row: span 2;
  }

  /* 5+ photos */
  .gallery-mosaic--5plus {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: 420px;
  }

  .gallery-mosaic--5plus .gallery-mosaic__tile--0 {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* ==========================================================================
   Pulse (posts)
   ========================================================================== */

.post-card {
  break-inside: avoid;
  margin-bottom: 1rem;
}

.post-card img,
.post-card video {
  display: block;
}

.file-drop-zone {
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.file-drop-zone.active {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
}

/* Hide file input inside drop zone */
.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ==========================================================================
   News article typography
   ========================================================================== */

.prose-like p {
  margin-bottom: 1rem;
}

.prose-like p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Utility tweaks
   ========================================================================== */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Textarea fields labeled "Описание" */
.textarea-description {
  min-height: 50px;
  resize: vertical;
}

/* ==========================================================================
   Custom select field
   ========================================================================== */

.select-field {
  position: relative;
}

/* Native select stays in the form for submit, validation and change events */
.select-field__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.select-field__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  font-size: 0.9375rem;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-field__trigger:hover {
  border-color: #9ca3af;
}

.select-field__trigger:focus,
.select-field--open .select-field__trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.select-field--error .select-field__trigger {
  border-color: var(--color-danger);
}

.select-field__trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-field__trigger-text--placeholder {
  color: var(--color-text-muted);
}

.select-field__trigger-icon {
  flex-shrink: 0;
  margin-left: 0.5rem;
  color: #6b7280;
  transition: transform 0.15s ease;
}

.select-field--open .select-field__trigger-icon {
  transform: rotate(180deg);
}

.select-field__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 320px;
  overflow: hidden;
}

.select-field--open .select-field__dropdown {
  display: flex;
}

.select-field__dropdown-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.select-field__dropdown-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
}

.select-field__dropdown-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: #6b7280;
  cursor: pointer;
}

.select-field__dropdown-close:hover {
  background-color: #f3f4f6;
  color: var(--color-text);
}

.select-field__search {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
  outline: none;
}

.select-field__search:focus {
  box-shadow: inset 0 -2px 0 0 var(--color-primary);
}

.select-field__options {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.select-field__option {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.select-field__option:hover,
.select-field__option--highlighted {
  background-color: #f3f4f6;
}

.select-field__option--selected {
  color: var(--color-primary);
  font-weight: 500;
}

.select-field__option:disabled,
.select-field__option--disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.select-field__empty {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.select-field__error {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-danger);
}

.select-field--error .select-field__error {
  display: block;
}

.br-6{
  border-radius: 6px;
}

/* Mobile full-screen sheet */
@media (max-width: 639px) {
  .select-field__dropdown--mobile {
    position: fixed;
    inset: 0;
    top: 0;
    border-radius: 0;
    max-height: 100vh;
    max-height: 100dvh;
    z-index: 100;
  }

  .select-field__dropdown--mobile .select-field__dropdown-header {
    display: flex;
  }

  .select-field__dropdown--mobile .select-field__options {
    max-height: none;
  }
}

body.select-field-body-locked {
  overflow: hidden;
}

/* Smooth scroll target for custom selects */
form[data-controller~="form-validation"] .select-field__trigger,
form[data-controller~="form-validation"] .select-field {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.lbm_abs{
  position: absolute;
  height: 28px;
  width: 28px;
  top: 10px;
  left: 10px;
}
@keyframes locate-ring {
  0%   { box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 0   rgba(207, 2, 52, .35); }
  70%  { box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 12px rgba(207, 2, 52, 0);  }
  100% { box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 0   rgba(207, 2, 52, 0);  }
}

.lbm_abs {
  animation: locate-ring 2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lbm_abs { animation: none; }
}

/* ==========================================================================
   Reactions (Noto Emoji icons + micro-interactions)
   ========================================================================== */

.reaction-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 150ms ease;
}

.reaction-button:hover .reaction-icon {
  transform: scale(1.2);
}

.reaction-icon--active {
  transform: scale(1.15);
}

@keyframes reaction-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.reaction-icon--pop {
  animation: reaction-pop 200ms ease;
}

.reaction-count {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .reaction-icon {
    transition: none;
  }

  .reaction-icon--pop {
    animation: none;
  }
}