/* ============================================================
   ПОПАП ДЕТАЛИЗАЦИИ КТ
   Шторка снизу на мобилке, диалог по центру на десктопе.
   Разметку создаёт js/kt-popup.js, в index.html её нет.
   ============================================================ */
/* ── Попап КТ ─────────────────────────────────────────── */
.rt-total--clickable {
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.rt-total--clickable:hover,
.rt-total--clickable:focus {
  background: color-mix(in srgb, var(--stamp) 10%, transparent);
  outline: 2px solid color-mix(in srgb, var(--stamp) 45%, transparent);
  outline-offset: -2px;
}

/* ── Popup: bottom-sheet на мобилке, центр на десктопе ── */
.kt-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .kt-popup { align-items: center; }
}
.kt-popup[hidden] { display: none; }

.kt-popup__backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}

.kt-popup__box {
  position: relative;
  z-index: 1;
  background: var(--paper-2);
  /* мобилка — bottom sheet */
  border-radius: 18px 18px 0 0;
  padding: 8px 20px 32px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.18);
}
@media (min-width: 600px) {
  .kt-popup__box {
    border-radius: 14px;
    padding: 28px 32px 24px;
    min-width: 320px;
    max-width: 460px;
    width: 90%;
    max-height: none;
    box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  }
}

/* drag handle */
.kt-popup__handle {
  width: 40px; height: 4px;
  background: var(--line-2); border-radius: 2px;
  margin: 12px auto 20px;
}
@media (min-width: 600px) { .kt-popup__handle { display: none; } }

.kt-popup__close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 18px; line-height: 1;
  cursor: pointer; color: var(--ink-soft);
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.kt-popup__close:hover { background: var(--paper-3); color: var(--ink); }

.kt-popup__title {
  margin: 0 0 18px;
  font-family: 'Golos Text', sans-serif;
  font-size: 1rem; font-weight: 700;
  line-height: 1.35;
}

@media (min-width: 600px) {
  .kt-popup__title { padding-right: 40px; }
}
@media (max-width: 599px) {
  .kt-popup__close { display: none; }
  .kt-popup__title { text-align: center; }
}

.kt-popup__table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem; table-layout: fixed;
}
.kt-popup__col-name   { width: 55%; }
.kt-popup__col-weight { width: 22%; }
.kt-popup__col-score  { width: 23%; }

.kt-popup__table th,
.kt-popup__table td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.kt-popup__table th {
  font-weight: 600; color: var(--ink-soft);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.kt-popup__table th.kt-popup__col-weight,
.kt-popup__table th.kt-popup__col-score,
.kt-popup__table td.kt-popup__col-weight,
.kt-popup__table td.kt-popup__col-score {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
}
.kt-popup__table th.kt-popup__col-weight,
.kt-popup__table th.kt-popup__col-score {
  font-family: 'Golos Text', sans-serif;
  font-size: 0.78rem;
}
.kt-popup__table tbody tr:last-child td { border-bottom: none; }

.kt-popup__total {
  margin-top: 16px; padding-top: 14px;
  border-top: 2px solid var(--line);
  font-size: 0.95rem; text-align: right; color: var(--ink);
}
.kt-popup__total strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; color: var(--stamp); margin-left: 6px;
}
