/* ============================================================
   Khan SAT-1600 · эфир на сайте (v160.10)
   Author: Xudoyorxon Bunyodov / Худоёрхон Бунёдов
   Студия ведущего, просмотр, плашка «идёт эфир», окно вызова.
   ============================================================ */
.kl { --l-g: #1B5E20; --l-g2: #2E7D32; --l-gold: #C9A227; --l-red: #D32F2F; --l-ink: var(--ink, #1A211B); --l-mut: var(--muted, #5C6B5F);
  --l-line: var(--line, #DCE5DD); --l-card: var(--paper, #fff); --l-soft: #EEF4EE;
  max-width: 1320px; margin: 0 auto; padding: 4px 0 48px; color: var(--l-ink); }
[data-theme="dark"] .kl { --l-soft: #1B2B20; --l-card: #141D17; --l-ink: #E6EEE7; --l-mut: #A9B8AC; --l-line: #2C3B31; }
.kl *, .kl *::before, .kl *::after { box-sizing: border-box; }
.kl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #E53935; box-shadow: 0 0 0 0 rgba(229, 57, 53, .6); animation: kl-pulse 1.6s infinite; vertical-align: middle; }
@keyframes kl-pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, .55); } 70% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); } }
@media (prefers-reduced-motion: reduce) { .kl-dot, .kl-ring-ic { animation: none !important; } }
.kl-navlink .kl-dot { margin: 0 2px 2px; }

.kl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.kl-head h1 { margin: 4px 0 4px; font-size: clamp(22px, 3vw, 30px); line-height: 1.2; }
.kl-head p { margin: 0; color: var(--l-mut); font-size: 14px; }
.kl-onair { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12.5px; color: var(--l-red); background: rgba(211, 47, 47, .09);
  border: 1px solid rgba(211, 47, 47, .3); padding: 3px 10px 3px 8px; border-radius: 999px; }
.kl-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kl-muted { color: var(--l-mut); font-size: 13px; }

.kl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.kl-stage { position: relative; border-radius: 16px; overflow: hidden; background: #0B140D; aspect-ratio: 16 / 9; border: 1px solid #1F2B22; }
.kl-stage video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0B140D; }
.kl-stage video[hidden] { display: none; }
.kl-stage .kl-cam { position: absolute; right: 12px; bottom: 56px; width: 22%; min-width: 120px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); background: #000; }
.kl-ov { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: #E8F0EA; font-size: 15px; background: rgba(5, 12, 7, .55); }
.kl-ov[hidden] { display: none; }
.kl-ctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.kl-ctrl button { border: 1px solid rgba(255, 255, 255, .3); background: rgba(10, 20, 12, .55); color: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.kl-ctrl button:hover { background: rgba(255, 255, 255, .16); }
.kl-ctrl button.on { background: var(--l-gold); border-color: var(--l-gold); color: #1F1600; }
.kl-ctrl button.off { background: rgba(211, 47, 47, .75); }
.kl-ctrl button.pulse { animation: kl-btn 1.2s ease-in-out 4; background: var(--l-gold); color: #1F1600; border-color: var(--l-gold); }
@keyframes kl-btn { 50% { transform: scale(1.06); } }
.kl-stage:fullscreen { border-radius: 0; border: 0; }
.kl-prev .kl-tag { position: absolute; left: 12px; top: 10px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .45); padding: 3px 10px; border-radius: 999px; }

.kl-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kl-side h2 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.kl-side h2 small { color: var(--l-mut); font-weight: 700; }
.kl-box, .kl-chat, .kl-card { background: var(--l-card); border: 1px solid var(--l-line); border-radius: 14px; padding: 12px 14px; }
.kl-called { background: #FFF4D6; border: 1.5px solid var(--l-gold); color: #4A3A00; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.kl-called.me { background: var(--l-gold); color: #1F1600; font-weight: 700; }
[data-theme="dark"] .kl-called { background: #2A2410; color: #E8CF7A; }
.kl-hand { width: 100%; justify-content: center; }
.kl-hand.on { background: var(--l-gold); border-color: var(--l-gold); color: #1F1600; }
.kl-msgs { height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 6px; }
.kl-msg { font-size: 13.5px; line-height: 1.4; padding: 6px 9px; border-radius: 10px; background: var(--l-soft); word-break: break-word; }
.kl-msg b { display: block; font-size: 12px; color: var(--l-g2); }
.kl-msg.host { background: rgba(201, 162, 39, .16); }
.kl-msg.host b { color: #7A5D00; }
[data-theme="dark"] .kl-msg.host b { color: #E8CF7A; }
.kl-msg.mine { border: 1px solid var(--l-line); background: transparent; }
.kl-chat form { display: flex; gap: 6px; margin-top: 6px; }
.kl-chat input { flex: 1 1 auto; min-width: 0; height: 38px; border-radius: 10px; border: 1px solid var(--l-line); background: var(--l-card); color: var(--l-ink); padding: 0 10px; font: inherit; font-size: 14px; }
.kl-chat form.off button { display: none; }
.kl-chk { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--l-mut); display: inline-flex; align-items: center; gap: 4px; }
.kl-people { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.kl-person { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--l-line); }
.kl-person small { display: block; color: var(--l-mut); font-size: 11.5px; }
.kl-person.called { border-color: var(--l-gold); background: rgba(201, 162, 39, .12); }
.kl-up { font-weight: 700; color: var(--l-g2); }
.kl-up.bad { color: var(--l-red); }
.kl-stop { color: var(--l-red) !important; border-color: rgba(211, 47, 47, .5) !important; }

/* студия: настройка */
.kl-setup { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.kl-f { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13.5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.kl-f legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.kl-f input, .kl-f select { height: 42px; border-radius: 10px; border: 1px solid var(--l-line); background: var(--l-card); color: var(--l-ink); padding: 0 12px; font: inherit; font-size: 15px; font-weight: 400; }
.kl-row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: end; }
.kl-row .kl-f { flex: 1 1 260px; }
.kl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.kl-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.kl-opts--3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kl-opts--col { grid-template-columns: minmax(0, 1fr); }
.kl-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--l-line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 400; }
.kl-opt input { margin-top: 3px; accent-color: var(--l-g); }
.kl-opt b { display: block; font-size: 14.5px; }
.kl-opt small { display: block; color: var(--l-mut); font-size: 12.5px; margin-top: 2px; }
.kl-opt:has(input:checked) { border-color: var(--l-g2); background: var(--l-soft); }
.kl-opt--sm { padding: 8px 12px; }
.kl-picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 240px; overflow-y: auto; margin-top: 8px; padding: 8px; border: 1px solid var(--l-line); border-radius: 10px; }
.kl-pick { display: flex; align-items: baseline; gap: 8px; font-weight: 400; font-size: 13.5px; }
.kl-pick small { color: var(--l-mut); }
.kl-pick[hidden] { display: none; }
.kl-search { margin-top: 8px; width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--l-line); background: var(--l-card); color: var(--l-ink); padding: 0 10px; font: inherit; }
.kl-warn { border: 1.5px solid var(--l-red); background: rgba(211, 47, 47, .07); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; }
.kl-warn p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; }
.kl-card h2 { margin: 0 0 8px; font-size: 16px; }
.kl-card + .kl-card { margin-top: 14px; }
.kl-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kl-hist li { display: flex; flex-direction: column; font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--l-soft); }
.kl-hist span { color: var(--l-mut); font-size: 12.5px; }

/* пустые состояния */
.kl-empty { max-width: 560px; margin: 48px auto; text-align: center; padding: 28px 20px; background: var(--l-card); border: 1px solid var(--l-line); border-radius: 18px; }
.kl-empty-ic { font-size: 44px; }
.kl-empty h1 { font-size: 22px; margin: 8px 0 6px; }
.kl-empty p { color: var(--l-mut); line-height: 1.55; }

/* плашка «идёт эфир» */
.kl-pill { position: fixed; left: 16px; bottom: 16px; z-index: 8900; display: flex; align-items: center; gap: 2px; background: #10180F; color: #fff; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); border: 1px solid rgba(201, 162, 39, .55); max-width: calc(100vw - 32px); }
.kl-pill a { display: flex; align-items: center; gap: 8px; padding: 9px 4px 9px 14px; color: #fff; text-decoration: none; min-width: 0; font-size: 13.5px; }
.kl-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; color: rgba(255, 255, 255, .8); }
.kl-pill em { font-style: normal; font-weight: 800; color: var(--l-gold, #C9A227); white-space: nowrap; }
.kl-pill button { border: 0; background: none; color: rgba(255, 255, 255, .7); font-size: 14px; padding: 8px 12px 8px 6px; cursor: pointer; }

/* окно вызова */
.kl-ring { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: rgba(6, 14, 8, .55); padding: 16px; }
.kl-ring-b { width: min(440px, 100%); background: var(--paper, #fff); color: var(--ink, #1A211B); border-radius: 20px; padding: 22px 22px 18px; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4); border: 2px solid #C9A227; }
[data-theme="dark"] .kl-ring-b { background: #141D17; color: #E6EEE7; }
.kl-ring-ic { font-size: 46px; animation: kl-shake 1s ease-in-out 3; }
@keyframes kl-shake { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.kl-ring-b b { display: block; font-size: 19px; margin: 6px 0 4px; }
.kl-ring-t { font-weight: 700; font-size: 16px; margin: 0 0 6px; }
.kl-ring-b p { margin: 6px 0; line-height: 1.5; font-size: 14px; }
.kl-ring-a { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.kl-ring--call .kl-ring-b { border-color: #D32F2F; }
.kl-dlg .kl-ring-b { text-align: left; }
.kl-dlg .kl-opts { margin-top: 10px; }

@media (max-width: 900px) {
  .kl-grid { grid-template-columns: minmax(0, 1fr); }
  .kl-msgs { height: 260px; }
  .kl-stage .kl-cam { width: 30%; bottom: 52px; }
}
@media (max-width: 600px) {
  .kl-pill { left: 8px; right: 8px; bottom: 72px; }
  .kl-pill span { max-width: 28vw; }
  .kl-ctrl button { padding: 6px 10px; font-size: 12.5px; }
  .kl-head { align-items: flex-start; }
}
