/* ================================
   🌊 KOMUNALKA PAGE — TalneServiceOnline
   Сучасний стиль (SX), узгоджений з Taxes
   ================================ */

/* Прибираємо прозорість — як у Taxes */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--color-bg-gradient-community) !important;
  background-size: cover;
  background-attachment: fixed;
}

/* Основний стиль сторінки */
body.komunalka {
  font-family: "Philosopher", sans-serif;
  color: var(--color-text-main);
}

/* Головний фон і контейнер */
#mainInterface {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 26px 16px 26px;
  box-sizing: border-box;
  animation: fadeInUp 0.9s ease forwards;
}

/* Центральний блок, як у Taxes */
#mainInterface .content-box {
  width: 100%;
  max-width: 1170px;
  padding: 16px 22px 34px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-main);
  box-shadow: var(--shadow-main);
  animation: contentAppear 0.9s ease forwards 0.3s;
}

#mainInterface,
#mainInterface .content-box,
.ts-address-group,
.ts-search-layout,
.ts-row-address {
  overflow: visible !important;
}

#mainInterface .content-box h2 {
  text-align: center;
  margin: 0 0 0 0;
}

#mainInterface .content-box p {
  font-size: 1.05rem;
  line-height: 1.5;
}

.title-p {
  text-align: center;
}

/* ================================
   🔖 Вкладки підприємств
   ================================ */

.kp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 16px;
  justify-content: center;
}

.kp-tab {
  padding: 10px 18px;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text-main);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
}

.kp-tab.active {
  background: #ffd65a;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kp-tab:hover {
  transform: translateY(-1px);
}

/* Панелі КП */
.kp-panel {
  display: none;
  margin-top: 8px;
}

.kp-panel.active {
  display: block;
}

/* Опис та мета */
.kp-description {
  margin-top: 4px;
}

.kp-meta {
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.9;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kp-meta-dot {
  opacity: 0.6;
}

/* ================================
   📦 Карточні блоки секцій
   ================================ */

.kp-block {
  margin-top: 20px;
  padding: 16px 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(5px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.kp-block-header h4 {
  margin: 0 0 4px 0;
}

.kp-block-header p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ================================
   🧩 Картки послуг
   ================================ */

.kp-cards {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kp-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: none;
  background: #ffffff !important;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

/* 🎨 Hover — синя заливка */
.kp-card:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #1e90ff, #03a5ed) !important;
  box-shadow: 0 5px 14px rgba(0, 74, 173, 0.35);
  color: #ffffff !important;
}

.kp-card:hover h5,
.kp-card:hover p,
.kp-card:hover .kp-card-emoji {
  color: #ffffff !important;
}

/* 🛠 Фікс залипання після кліку */
.kp-card:active {
  transform: translateY(0) !important;
  background: #ffffff !important;
  color: #1a1a1a !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.kp-card-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.kp-card-text h5 {
  margin: 0 0 2px 0;
  font-size: 1rem;
}

.kp-card-text p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Основні кольори карток за замовчуванням */
.kp-card,
.kp-card h5,
.kp-card p,
.kp-card-emoji {
  color: #1a1a1a !important;
}

/* ============================
   🔙 Кнопка “Повернутись” (загальна)
   ============================ */

.back-button-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 0;
  animation: fadeInUp 0.9s ease forwards;
  animation-delay: 0.9s;
  width: 100%;
}

.back-btn {
  max-width: 360px;
  width: 90%;
  min-height: 48px;
  padding: 12px 0;
  font-size: 1.1rem;
}

/* ============================
   📌 корекція футера 
   ============================ */

.app-footer,
.footer-bottom {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding-left: clamp(10px, 3vw, 25px);
  padding-right: clamp(10px, 3vw, 25px);
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ================================
   🧩 НОВИЙ МАКЕТ ПОШУКУ КП «ТАЛЬНЕ-СЕРВІС»
   ================================ */

.ts-search-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Базовий ряд */
.ts-row {
  display: flex;
  gap: 12px;
}

/* 2 колонки (рахунок + прізвище) */
.ts-row-two .ts-field {
  flex: 1;
}

/* 4-колоночний ряд адреси */
.ts-row-address .ts-field {
  display: flex;
  flex-direction: column;
}

/* Тип — трохи вже, назва — ширша, будинок/квартира — компактні */
.ts-row-address .ts-field:nth-child(1) {
  flex: 0.8;
}

.ts-row-address .ts-field:nth-child(2) {
  flex: 1.6;
}

.ts-row-address .ts-field:nth-child(3),
.ts-row-address .ts-field:nth-child(4) {
  flex: 0.7;
}

/* Формат поля */
.ts-field label {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.ts-field input,
.ts-field select {
  width: 100%;
}

/* Повна ширина (населений пункт) */
.ts-field-full {
  width: 100%;
}

/* Маленькі поля (будинок/квартира) */
.ts-field-small select {
  text-align: center;
}

/* Блок адреси: рамка, скло, заокруглення */
.ts-address-group {
  margin-top: 4px;
  padding: 12px 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(207, 215, 227, 0.95);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Заголовок блоку адреси */
.ts-address-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.9;
}

/* Placeholder-стиль для "порожніх" option */
.ts-field select option[value=""],
.ts-field select option[value=" "] {
  color: #9ca3af;
}

.ts-field select:invalid {
  color: #9ca3af;
}

/* Загальний placeholder для select з пустим value */
select option[value=""] {
  color: #9ca3af;
}

/* Кнопка ЗНАЙТИ */
.kp-action-btn {
  margin-top: 8px;
  width: 100%;
  background: #ffd65a !important;
  color: #000 !important;
  border: none;
  padding: 12px 0;
  border-radius: 14px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.kp-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Повідомлення про помилки */
.ts-error {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  background: rgba(255, 55, 55, 0.2);
  color: #a40000;
  border-left: 4px solid #ff4444;
}

/* ============================================
   ⭐ НОВИЙ ПОВНИЙ СТИЛЬ ДЛЯ ts-search-block
   ============================================ */

#ts-search-block {
  margin-top: 20px;
  padding: 22px 22px 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  animation: fadeInUp 0.5s ease;
}

/* Заголовок */
#ts-search-block h3 {
  margin: 0 0 14px 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

/* Підказка */
.ts-hint {
  background: rgba(255, 255, 255, 0.8);
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
}

/* Контейнер полів */
.ts-search-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Ряд */
.ts-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

/* Поля */
.ts-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ts-field label {
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.ts-field input,
.ts-field select {
  padding: 12px;
  font-size: 1rem;
  border-radius: 14px;
  border: 1px solid #cfd7e3;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.ts-field input:focus,
.ts-field select:focus {
  border-color: #1e90ff;
  box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.25);
  outline: none;
}

/* Блок адреси */
.ts-address-group {
  padding: 16px 16px 18px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  border: 1px solid rgba(200, 210, 220, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.ts-address-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Ряд адреси */
.ts-row-address {
  display: flex;
  gap: 16px;
}

/* Колонки адреси */
.ts-row-address .ts-field:nth-child(1) {
  flex: 0.8;
}

.ts-row-address .ts-field:nth-child(2) {
  flex: 1.6;
}

.ts-row-address .ts-field:nth-child(3),
.ts-row-address .ts-field:nth-child(4) {
  flex: 0.7;
}

/* Кнопка Знайти */
#ts-search-btn {
  margin-top: 12px;
  width: 100%;
  padding: 14px 0;
  border-radius: 16px;
  background: #ffd65a;
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

#ts-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Пошуковий блок завжди над «Додатковою інформацією» */
#ts-search-block {
  position: relative;
  z-index: 30;
}

/* kp-block залишаємо нижче */
.kp-block {
  position: relative;
  z-index: 5;
}

/* Error */
.ts-error {
  background: rgba(255, 60, 60, 0.22);
  color: #a40000;
  border-left: 4px solid #ff3333;
  padding: 10px 14px;
  border-radius: 12px;
  margin-top: 10px;
}
.ts-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  margin-top: 4px;
}

.ts-badge-debt {
  background: rgba(220, 53, 69, 0.15);
  color: #c82333;
  border-left: 4px solid #dc3545;
}

.ts-badge-overpay {
  background: rgba(40, 167, 69, 0.15);
  color: #1e7e34;
  border-left: 4px solid #28a745;
}

.ts-badge-zero {
  background: rgba(0, 123, 255, 0.1);
  color: #0056b3;
  border-left: 4px solid #007bff;
}

/* Верхній індикатор пошуку */
.ts-loading-top-box {
  margin: 10px auto 15px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  font-size: 1rem;
  color: #003366;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ts-loading-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #1e90ff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Кнопка у стані loading */
.ts-btn-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ====== 📱 Адаптив ====== */

@media (max-width: 900px) {
  .ts-row {
    flex-direction: column;
  }

  .ts-row-address {
    flex-direction: column;
  }

  #ts-search-block {
    padding: 18px 14px 22px;
  }
}

/* ================================
   📊 БЛОК РЕЗУЛЬТАТІВ ПОШУКУ
   ================================ */

.ts-user-info {
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  margin-bottom: 14px;
}

.ts-user-info h4 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

/* ================================
   🔴 ДАТА СТАНУ У ЗАГОЛОВКУ
   ================================ */

.vod-state-label {
  font-weight: 600;
  margin-left: 6px;
}

.vod-state-date {
  color: #c40000;
  font-weight: 800;

  /* ➕ ПІДКРЕСЛЕННЯ */
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ================================
   🔴 ДАТА СТАНУ — КП «ТАЛЬНЕ-СЕРВІС»
   ================================ */

.ts-state-label {
  font-weight: 600;
  margin-left: 6px;
}

.ts-state-date {
  color: #c40000;
  font-weight: 800;

  /* 🔻 підкреслення */
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ts-user-info p {
  margin: 3px 0;
  font-size: 0.97rem;
}
/* ВЕЛИКИЙ БЛОК результатів — тепер містить і кнопки, і інфо */
#ts-services-block {
  padding: 18px 16px 20px !important;
}

/* СИНЯ СТАНДАРТНА КНОПКА — ЯК У НИЗУ СТОРІНКИ */
.kp-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 10px 22px;
  margin-top: 12px;

  background: linear-gradient(135deg, #1e90ff, #0062ff);
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 600;

  border: none;
  border-radius: 30px;
  cursor: pointer;

  box-shadow: 0 6px 20px rgba(0, 80, 180, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease;
}

.kp-secondary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 80, 200, 0.45);
}

.kp-secondary-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 80, 170, 0.3);
}

/* ⛔ Фікс: інпут "Ваше прізвище" вилізає */
.ts-row-two {
  display: flex;
  gap: 16px;
  width: 100%;
}

.ts-row-two .ts-field {
  flex: 1; /* обидва поля займають рівну ширину */
  min-width: 0; /* запобігає переповненню */
}

.ts-row-two input {
  width: 100%;
  box-sizing: border-box; /* ширина враховує padding */
}

/* ===================================
   🌟 МОДАЛКА ПОМИЛОК (СТИЛЬ TAXES)
   =================================== */

/* === FULLSCREEN OVERLAY === */
.ts-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 12px 40px;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.ts-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

/* === MODAL BODY === */
.ts-modal-content {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #e6f3ff 50%, #c4e2ff 100%);
  padding: 30px 28px;
  max-width: 520px;
  width: 100%;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  animation: modalPop 0.35s ease-out forwards;
}

/* === Close X === */
.ts-modal-close-x {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 26px;
  color: #004080;
  cursor: pointer;
  font-weight: 700;
  transition: 0.25s ease;
}
.ts-modal-close-x:hover {
  opacity: 0.55;
  transform: scale(1.15);
}

/* === ICON === */
.ts-modal-icon {
  font-size: 46px;
  margin-bottom: 12px;
  color: #c98200;
}

/* === TEXT === */
.ts-modal-text {
  font-size: 18px;
  color: #033;
  line-height: 1.55;
  margin-bottom: 26px;
  text-align: center;
}
.ts-modal-text b,
.ts-modal-text span {
  color: #b10000;
  font-weight: 700;
}

/* === BUTTON === */
.ts-modal-close {
  padding: 12px 32px;
  background: linear-gradient(135deg, #0077cc, #005fa3);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
}
.ts-modal-close:hover {
  background: linear-gradient(135deg, #0088ff, #0066c2);
  transform: translateY(-1px) scale(1.03);
}

/* === ANIMATIONS === */
@keyframes modalPop {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeOutModal {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* === HIGH CONTRAST MODE (авто) === */
@media (prefers-contrast: more) {
  .ts-modal-content {
    background: #ffffff !important;
    color: black !important;
    box-shadow: 0 0 0 3px black;
  }
  .ts-modal-close,
  .ts-modal-close-x {
    background: black !important;
    color: white !important;
  }
}

/* ============================
   Службові класи
   ============================ */

.hidden {
  display: none !important;
}
/* ================================
   🌟 SX AUTOCOMPLETE ДЛЯ АДРЕС
   ================================ */

.ts-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

/* Інпут автодоповнення */
.ts-autocomplete-input {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #cfd7e3;
  background: #ffffff;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.ts-autocomplete-input:focus {
  border-color: #1e90ff;
  box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.25);
  outline: none;
}

/* Список підказок (скляний SX-стиль) */
.ts-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;

  /* 🔥 ключове виправлення */
  z-index: 9999;

  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  border: 1px solid rgba(200, 210, 220, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);

  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}

/* Окремий елемент списку */
.ts-autocomplete-item {
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  color: #102a43;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.ts-autocomplete-item:hover {
  background: linear-gradient(135deg, #e3f2ff, #cfe8ff);
  transform: translateY(-1px);
}

/* Позначаємо, що select "службовий" (ховаємо з очей) */
.ts-autocomplete-hidden-select {
  display: none !important;
}

/* Якщо списку не вистачає місця знизу — відкриваємо його догори */
.ts-autocomplete-list.ts-dropdown-up {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;

  /* Тінь «зверху вниз», щоб виглядало природно */
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
}

/* ============================================================
   🌟 1. ГЛОБАЛЬНИЙ КОНТРАСТНИЙ РЕЖИМ (як у Taxes)
   ============================================================ */

body.contrast-mode {
  filter: grayscale(100%) brightness(0.95) contrast(1.15);
  transition: filter 0.4s ease;
}

/* Hover-контраст для інтерактивних блоків */
body.contrast-mode .kp-card:hover,
body.contrast-mode .tax-item:hover,
body.contrast-mode button:hover {
  filter: grayscale(100%) brightness(0.9) contrast(1.25);
}

/* Emoji ефекти */
body.contrast-mode .emoji {
  filter: grayscale(100%) brightness(0.9) contrast(1.3);
}
body.contrast-mode .emoji:hover {
  filter: grayscale(100%) brightness(0.8) contrast(1.4);
  transform: scale(1.08);
}

/* ============================================================
   🌟 2. Додавання контуру до всіх карток у контрастному режимі
   ============================================================ */

body.contrast-mode .kp-card {
  border: 2px solid rgba(14, 13, 13, 0.35) !important;
  border-radius: 12px !important;
}

body.contrast-mode .ts-user-info,
body.contrast-mode .kp-secondary-btn,
body.contrast-mode .ts-hint,
body.contrast-mode .tax-item,
body.contrast-mode .total {
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 12px !important;
}

/* ============================================================
   🌟 3. Контрастний режим для модального вікна
   ============================================================ */

body.contrast-mode .ts-modal-content {
  background: #222 !important;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
}

body.contrast-mode .ts-modal-text {
  color: #eee !important;
}

body.contrast-mode .ts-modal-icon {
  color: #e6e6e6 !important;
  filter: grayscale(100%) brightness(1.2);
}

body.contrast-mode .ts-modal-close-x {
  color: #fff !important;
}

body.contrast-mode .ts-modal-close {
  background: #ffe082 !important;
  color: #000 !important;
}

/* ============================
   Анімації
   ============================ */

@keyframes contentAppear {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
   📱 Адаптація
   ============================ */

@media (max-width: 900px) {
  #mainInterface {
    padding: 26px 10px 40px;
  }

  #mainInterface .content-box {
    padding: 22px 14px 26px;
  }

  .kp-cards {
    grid-template-columns: 1fr; /* 1 колонка на телефоні */
  }

  .kp-search {
    padding: 16px 12px 20px;
  }

  .ts-row {
    flex-direction: column;
  }

  .ts-row-address {
    flex-direction: column;
  }

  .ts-address-group {
    padding: 12px 10px 14px;
  }
}

@media (min-width: 1180px) {
  #mainInterface .content-box h2 {
    font-size: 2.1rem;
  }
}
/* Контейнер двох кнопок */
.ts-buttons-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

/* ОБИДВІ КНОПКИ — жовті */
.ts-btn-find,
.ts-btn-reset {
  flex: 1;

  background: #ffd65a !important;
  color: #000 !important;
  border: none;

  padding: 14px 0;
  border-radius: 16px;

  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;

  /* 🔥 Центрування тексту */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Hover */
.ts-btn-find:hover,
.ts-btn-reset:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

/* Active */
.ts-btn-find:active,
.ts-btn-reset:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* 📱 Адаптив: на мобільному — стопчиком */
@media (max-width: 650px) {
  .ts-buttons-row {
    flex-direction: column;
  }

  .ts-btn-find,
  .ts-btn-reset {
    width: 100%;
  }
}
/* ============================================
   🌐 GLOBAL FULLSCREEN LOADER
   ============================================ */
.global-loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh; /* 👈 ДОМІНАНТНА ПРАВКА */
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9999;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.global-loader.show {
  opacity: 1;
  pointer-events: all;
}

.global-loader-content {
  text-align: center;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
}

/* Спінер */
.global-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #dcdcdc;
  border-top-color: #1e90ff;
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================
   🔵 МОДАЛКА ПЕРЕХРЕСНОГО ПОШУКУ
   ============================ */

.cross-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 99999;
}

/* Клас hidden — приховує */
.cross-modal.hidden {
  display: none;
}

/* Клас show — показує */
.cross-modal.show {
  display: flex;
}

.cross-modal-window {
  background: #fff;
  padding: 25px 20px; /* Трохи зменшив бокові відступи всередині */
  border-radius: 16px; /* Більш округлі кути */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  box-sizing: border-box; /* ✅ Важливо: щоб padding не ламав ширину */

  /* 🔥 Центрування строго по видимому екрану */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* ✅ БУЛО: width: 90%; */
  /* ✅ СТАЛО: Гарантований відступ 16px з країв */
  width: calc(100% - 32px);
  max-width: 400px;

  animation: pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Трохи пружніша анімація */
}

@keyframes pop {
  from {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ❌ Кнопка закриття */
.cross-close {
  position: absolute;
  top: 10px;
  right: 12px;

  background: #fff0f0;
  border: none; /* Прибрав рамку для чистоти */
  color: #d32f2f;

  font-size: 24px;
  line-height: 1;

  width: 36px;
  height: 36px;
  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  transition: all 0.2s ease;
}

.cross-close:hover {
  background: #ffe0e0;
  transform: scale(1.1) rotate(90deg); /* Додав обертання при наведенні */
}

.cross-buttons {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================================
   📱 АДАПТАЦІЯ (MOBILE)
   ============================================================ */

@media (max-width: 480px) {
  .cross-buttons {
    flex-direction: column-reverse; /* Кнопки стовпчиком */
    width: 100%;
  }

  /* 👇 Тут важливо! У тебе в HTML класи кнопок .ts-btn-find і .ts-btn-reset, 
     але в старому CSS були .cross-btn. 
     Я зробив універсально для всіх кнопок всередині .cross-buttons 
  */
  .cross-buttons button {
    width: 100%;
    padding: 14px 0;
    font-size: 16px; /* Більший шрифт для пальця */
  }

  .cross-modal-window p {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}
/* ============================================================
   📄 МОДАЛКА ВИБОРУ КВИТАНЦІЇ (SX STYLE)
   ============================================================ */

/* Корекція ширини контенту спеціально для цього вікна */
.receipt-modal-box {
  max-width: 480px !important; /* Трохи ширше для зручності кнопок */
  padding: 34px 24px 28px !important;
}

/* Контейнер кнопок (стек) */
.receipt-options-stack {
  display: flex;
  flex-direction: column;
  gap: 14px; /* Відступ між кнопками */
  width: 100%;
  margin-bottom: 24px;
}

/* Стиль кнопок вибору */
.receipt-opt-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 20px;

  /* Білий фон з легкою прозорістю, як у твоїх блоках */
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.5); /* Напівпрозора рамка */
  border-radius: 16px; /* Радіус як у input/button */

  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;

  /* Тінь як у твоїх карток */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Ефекти наведення (Hover) */
.receipt-opt-btn:hover {
  transform: translateY(-3px); /* Піднімається, як .kp-card */
  border-color: #1e90ff; /* Синій акцент */
  background: #f4faff; /* Легкий синій відтінок */
  box-shadow: 0 8px 24px rgba(30, 144, 255, 0.25); /* Синя тінь */
}

/* Активний стан (клік) */
.receipt-opt-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Емодзі всередині кнопки */
.opt-emoji {
  font-size: 2rem;
  margin-right: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.receipt-opt-btn:hover .opt-emoji {
  transform: scale(1.1) rotate(5deg);
}

/* Текстовий блок */
.opt-text {
  display: flex;
  flex-direction: column;
}

.opt-text strong {
  font-size: 1.05rem;
  color: #003366; /* Темно-синій, читабельний */
  margin-bottom: 4px;
  font-weight: 700;
}

.opt-text small {
  font-size: 0.9rem;
  color: #556677; /* Спокійний сірий */
  line-height: 1.3;
}

/* Кнопка "Скасувати" — Жовта (Стиль TalneService) */
#receipt-modal-cancel {
  background: #ffd65a !important; /* Фірмовий жовтий */
  color: #000 !important; /* Чорний текст */
  border: none !important;
  font-weight: 700; /* Жирний шрифт */
  padding: 12px 30px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); /* Легка тінь */
  transition: all 0.25s ease;
}

#receipt-modal-cancel:hover {
  background: #ffcc33 !important; /* Трохи насиченіший при наведенні */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#receipt-modal-cancel:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================
    🌗 ПОКРАЩЕНИЙ КОНТРАСТНИЙ РЕЖИМ (CONTRAST MODE)
   ============================================================ */

/* Сама модалка в контрасті */
body.contrast-mode .ts-modal-content.receipt-modal-box {
  background: #000 !important;
  border: 3px solid #fff !important;
  color: #fff !important;
}

/* Заголовок та текст у модалці */
body.contrast-mode .ts-modal-content h3,
body.contrast-mode .ts-modal-content p {
  color: #fff !important;
}

/* Кнопки вибору формату */
body.contrast-mode .receipt-opt-btn {
  background: #000 !important;
  border: 2px solid #fff !important;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

/* Стан при наведенні або фокусі (High Visibility) */
body.contrast-mode .receipt-opt-btn:hover,
body.contrast-mode .receipt-opt-btn:focus {
  background: #ffff00 !important; /* Яскраво-жовтий фон — стандарт контрастності */
  border-color: #000 !important;
}

/* Текст всередині кнопок при наведенні стає чорним для читабельності на жовтому */
body.contrast-mode .receipt-opt-btn:hover .opt-text strong,
body.contrast-mode .receipt-opt-btn:hover .opt-text small,
body.contrast-mode .receipt-opt-btn:hover .opt-emoji {
  color: #000 !important;
}

/* Звичайний стан тексту в кнопках */
body.contrast-mode .opt-text strong {
  color: #fff !important;
  font-size: 1.2rem !important;
}

body.contrast-mode .opt-text small {
  color: #00ff00 !important; /* Зелений неон для другорядного тексту */
  font-weight: bold !important;
}

/* Кнопка "Скасувати" */
body.contrast-mode #receipt-modal-cancel {
  background: #ff0000 !important; /* Червоний для відміни */
  color: #fff !important;
  border: 2px solid #fff !important;
  font-weight: bold !important;
  text-transform: uppercase;
}

body.contrast-mode #receipt-modal-cancel:hover {
  background: #fff !important;
  color: #ff0000 !important;
}

/* Хрестик закриття */
body.contrast-mode .ts-modal-close-x {
  color: #fff !important;
  border: 2px solid #fff;
  padding: 5px;
  line-height: 1;
}
/* ============================================================
   📱 АДАПТАЦІЯ ДЛЯ МОБІЛЬНИХ (MISSING STYLES)
   Додає гнучкість новим модалкам на вузьких екранах
   ============================================================ */

@media (max-width: 600px) {
  /* 1. Корекція модалки вибору квитанції */
  .receipt-modal-box {
    padding: 24px 18px 22px !important; /* Менші внутрішні відступи */
    width: 90% !important; /* Ширина на весь екран з відступами */
    max-width: none !important;
  }

  /* 2. Компактні кнопки вибору */
  .receipt-opt-btn {
    padding: 12px 14px; /* Менші падінги кнопки */
    gap: 10px; /* Менша відстань між емодзі і текстом */
  }

  .opt-emoji {
    font-size: 1.6rem; /* Зменшуємо емодзі, щоб не займав пів екрану */
    margin-right: 0; /* Прибираємо margin, бо використовуємо gap */
  }

  .opt-text strong {
    font-size: 0.95rem; /* Трохи менший шрифт заголовка */
  }

  .opt-text small {
    font-size: 0.8rem; /* Компактний опис */
    line-height: 1.2;
  }

  /* 3. Кнопка скасування */
  #receipt-modal-cancel {
    width: 100%; /* На мобільному кнопку зручніше тиснути, коли вона широка */
    padding: 14px 0;
  }
}

/* ============================================================
   🖨️ СТИЛІ ДЛЯ ДРУКУ (PRINT FIX)
   Якщо користувач натисне Ctrl+P замість кнопки PDF
   ============================================================ */
@media print {
  /* Ховаємо все зайве, залишаємо лише контент, якщо раптом друкують сторінку */
  .kp-tabs,
  .back-button-box,
  .app-footer,
  .contrast-icon,
  #global-loader {
    display: none !important;
  }

  #mainInterface,
  #mainInterface .content-box {
    background: white !important;
    box-shadow: none !important;
    color: black !important;
    padding: 0;
    margin: 0;
  }
}
/* =========================================
   📝 Стилі для блоку передачі показників (Compact v2)
   ========================================= */

.meters-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* Менший відступ між картками */
}

.meter-row {
  background: #ffffff;
  border: 1px solid #dce1e9;
  border-radius: 8px; /* Менш круглі кути */
  padding: 10px 12px; /* 🔽 Зменшили внутрішні відступи */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s;
}

/* Якщо чекбокс вимкнено - робимо картку напівпрозорою */
.meter-row.disabled-row {
  opacity: 0.6;
  background: #fdfdfd;
}

/* Заголовок з чекбоксом */
.meter-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer; /* Щоб можна було клікати по всій шапці */
}

/* Чекбокс */
.meter-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #28a745;
}

/* Назва лічильника */
.meter-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #333;
}

/* Блок полів (в рядок) */
.meter-inputs {
  display: flex;
  gap: 15px;
  align-items: center;
}

.meter-group {
  flex: 1; /* Рівномірний поділ ширини */
  display: flex;
  flex-direction: column;
  min-width: 0; /* 🚑 РЯТУЄ ВІД ВИЛІЗАННЯ ЗА КРАЇ */
}

.meter-label {
  font-size: 0.75rem; /* Дрібніший шрифт підписів */
  color: #666;
  margin-bottom: 3px;
}

/* Поле ПОПЕРЕДНІ */
.meter-val-prev {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  padding: 6px 10px; /* Компактніше */
  background: #f4f6f9;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Поле ПОТОЧНІ (Input) */
.meter-input-field {
  width: 100%;
  box-sizing: border-box; /* 🚑 ВАЖЛИВО: враховує рамки в ширину */
  padding: 6px 10px; /* Компактніше */
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.meter-input-field:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

.meter-input-field:disabled {
  background-color: #eee;
  cursor: not-allowed;
}

.meter-input-field.error {
  border-color: #dc3545;
  background-color: #fffbfb;
}

/* Різниця */
.meter-diff {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: right;
  min-height: 1.2em; /* Щоб не стрибало */
}

.diff-plus {
  color: #28a745;
}
.diff-minus {
  color: #dc3545;
}
.diff-zero {
  color: #aaa;
}

/* 📱 Адаптив: на телефонах поля один під одним */
@media (max-width: 500px) {
  .meter-inputs {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .meter-diff {
    text-align: left;
  }
}
/* ============================================================
    🌗 КОНТРАСТНИЙ РЕЖИМ ДЛЯ ВСІХ МОДАЛОК
   ============================================================ */

/* Універсальна підкладка модалки в контрасті */
body.contrast-mode .ts-modal-content {
  background: #000 !important;
  border: 3px solid #fff !important;
  box-shadow: none !important;
}

/* Іконка успіху (зелена галочка) у контрасті */
body.contrast-mode #success-modal-icon {
  color: #00ff00 !important; /* Яскравий неон */
  text-shadow: 0 0 10px #00ff00;
}

/* Текст у всіх модалках */
body.contrast-mode .ts-modal-text,
body.contrast-mode .ts-modal-content h3 {
  color: #fff !important;
}

/* Кнопки "Чудово" / "Добре" у контрасті */
body.contrast-mode .ts-modal-close {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  font-weight: 900 !important;
}

body.contrast-mode .ts-modal-close:hover {
  background: #ffff00 !important; /* Жовтий акцент */
  color: #000 !important;
}

/* 🧾 Специфічні стилі для модалки квитанцій (Receipt) */
body.contrast-mode .receipt-opt-btn {
  background: #111 !important;
  border: 2px solid #fff !important;
}

body.contrast-mode .receipt-opt-btn:hover {
  background: #ffff00 !important; /* Жовтий фон при наведенні */
  border-color: #000 !important;
}

/* Переконаємось, що іконка-папірець у квитанціях теж контрастна */
body.contrast-mode .ts-modal-icon img {
  filter: invert(1) brightness(2);
}
