/* =========================================================================
   Контакты (/kontakty/)
   Крупные кнопки каналов, статус по московскому времени, циферблат с часами
   работы и таблица, путь первого контакта, подготовка к разговору с примером
   переписки, вопросы. Статус, стрелка и «сегодня» появляются только с JS
   (assets/js/scenes/onair.js), без JS видны часы работы таблицей.
   ========================================================================= */

/* ---------- статус по московскому времени (общий с «Об эксперте») ---------- */
.onair { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); line-height: 1.3; }
.onair[hidden] { display: none; }
/* с JS место под статус занято сразу, чтобы кнопки не прыгали при его появлении */
html.js .kt-status[hidden] { display: inline-flex; visibility: hidden; }
.onair-dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--fg-dim); }
.onair b { display: block; font-weight: 600; font-size: 0.92rem; }
.onair small { display: block; color: var(--fg-soft); font-size: 0.82rem; }
.onair[data-state="open"] .onair-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 191, 138, 0.2); }
.onair[data-state="open"] .onair-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); animation: onair-ping 2.2s var(--ease-out) infinite; }
.onair[data-state="closed"] .onair-dot { background: var(--signal); box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.18); }
@keyframes onair-ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }

/* ---------- первый экран ---------- */
.kt-status { justify-self: start; padding: 12px 18px 12px 16px; gap: 14px; border-radius: 16px; }
.kt-status .onair-dot { width: 12px; height: 12px; }
.kt-status b { font-size: 1rem; }
.kt-status small { font-size: 0.9rem; }

.kt-channels { list-style: none; display: grid; gap: 10px; max-width: 560px; }
.kt-ch {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  min-height: 76px; padding: 12px 20px 12px 14px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
  transition: border-color 0.25s, transform 0.35s var(--ease-out), background-color 0.25s;
}
.kt-ch:hover { border-color: var(--signal); background: var(--night-3); transform: translateX(4px); text-decoration: none; }
.kt-ch-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; }
.kt-ch-ico svg { width: 24px; height: 24px; fill: #fff; }
.kt-ch--tg .kt-ch-ico { background: #229ed9; }
.kt-ch--wa .kt-ch-ico { background: #1fa855; }
.kt-ch--tel .kt-ch-ico { background: var(--signal); }
.kt-ch--tel .kt-ch-ico svg { fill: var(--ink); }
.kt-ch--mail .kt-ch-ico { background: var(--flow); }
/* Адрес почты длиннее телефона: в одну строку на телефоне он не помещается, переносим после «@» */
.kt-ch--mail .kt-ch-txt b { white-space: normal; overflow-wrap: anywhere; }
.kt-ch-txt small { display: block; color: var(--fg-soft); font-size: 0.85rem; line-height: 1.3; }
.kt-ch-txt b { display: block; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.25rem); letter-spacing: -0.02em; line-height: 1.25; white-space: nowrap; }
.kt-ch-act { color: var(--fg-soft); font-size: 0.9rem; font-weight: 600; }
.kt-ch:hover .kt-ch-act { color: var(--signal); }
.kt-geo { margin: 0; color: var(--fg-soft); font-size: 0.97rem; max-width: 52ch; }

/* циферблат: 12:00 наверху, сутки по часовой стрелке */
.kt-stage { display: grid; align-content: center; justify-items: center; }
.kt-clock { display: grid; gap: 20px; width: 100%; max-width: 440px; }
.kt-dial svg { width: 100%; height: auto; overflow: visible; }
.kt-face { fill: rgba(17, 28, 51, 0.9); stroke: var(--night-line); stroke-width: 1.5; }
.kt-ticks line { stroke: #2c3c63; stroke-width: 2; stroke-linecap: round; }
.kt-ticks line.major { stroke: var(--fog-dim); stroke-width: 2.5; }
.kt-nums text { font-family: var(--font-text); font-size: 14px; font-weight: 600; fill: var(--fog); text-anchor: middle; }
.kt-track { fill: none; stroke: rgba(170, 181, 207, 0.08); stroke-width: 24; }
.kt-arc { fill: none; stroke-width: 24; stroke-linecap: round; transition: opacity 0.4s; }
.kt-arc--wd { stroke: var(--signal); }
.kt-arc--we { stroke: var(--flow-light); }
.kt-arc-label { font-family: var(--font-text); font-size: 12px; font-weight: 700; fill: var(--ink); letter-spacing: 0.02em; transition: opacity 0.4s; }
.kt-dial.is-live .kt-arc:not(.is-today) { opacity: 0.32; }
.kt-dial.is-live:has(#kt-arc-wd:not(.is-today)) .kt-arc-label--wd,
.kt-dial.is-live:has(#kt-arc-we:not(.is-today)) .kt-arc-label--we { opacity: 0.55; }
.kt-hand { opacity: 0; transition: opacity 0.4s; }
.kt-dial.is-live .kt-hand { opacity: 1; }
.kt-hand line { stroke: #eef2fb; stroke-width: 2.5; stroke-linecap: round; }
.kt-hand-base { fill: #eef2fb; }
.kt-hand-tip { fill: #eef2fb; }
.kt-hand-mark { fill: var(--signal); }
.kt-dial.is-open .kt-hand-mark, .kt-dial.is-open .kt-hand-tip { fill: var(--ok); filter: drop-shadow(0 0 6px rgba(47, 191, 138, 0.9)); }
.kt-time { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; fill: #eef2fb; font-variant-numeric: tabular-nums; }
.kt-sub { font-family: var(--font-text); font-size: 13px; fill: var(--fog); }

.kt-hours { width: 100%; border-collapse: collapse; }
.kt-hours caption { caption-side: top; padding-bottom: 8px; text-align: left; color: var(--fg-soft); font-size: 0.9rem; font-weight: 600; }
.kt-hours th, .kt-hours td { padding: 12px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 500; vertical-align: middle; }
.kt-hours td { padding-left: 16px; text-align: right; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kt-hours tr:last-child th, .kt-hours tr:last-child td { border-bottom: 1px solid var(--line); }
.kt-sw { display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 4px; vertical-align: -1px; }
.kt-sw--wd { background: var(--signal); }
.kt-sw--we { background: var(--flow-light); }
.kt-hours tr:not(.is-today) th, .kt-hours tr:not(.is-today) td { color: var(--fg-soft); }
.kt-hours:not(:has(.is-today)) th, .kt-hours:not(:has(.is-today)) td { color: var(--fg); }
.kt-today { display: inline-block; margin-left: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(47, 191, 138, 0.16); color: #8ce8c5; font-size: 0.75rem; font-weight: 600; vertical-align: 1px; }
.kt-local { margin: 0; color: var(--fg-soft); font-size: 0.9rem; }

/* ---------- первый контакт: 4 шага ---------- */
@media (min-width: 1081px) { .kt-path { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.kt-path .node { align-content: start; }
.kt-path .node small { max-width: 30ch; }

/* ---------- что подготовить ---------- */
.kt-prep-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.kt-prep { list-style: none; display: grid; border-top: 1px solid var(--line); }
.kt-prep li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.kt-prep b { display: block; font-weight: 600; line-height: 1.35; }
.kt-prep li > span:last-child > span { display: block; margin-top: 2px; color: var(--fg-soft); font-size: 0.95rem; }
.kt-check { position: relative; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--ok); background: var(--ok); transition: background-color 0.3s, border-color 0.3s, transform 0.4s var(--ease-out); }
.kt-check::after { content: ""; position: absolute; left: 6px; top: 5px; width: 9px; height: 5px; border-left: 2px solid var(--night); border-bottom: 2px solid var(--night); transform: rotate(-45deg); transition: opacity 0.3s; }
.kt-prep.is-armed .kt-check { background: transparent; border-color: var(--night-line); }
.kt-prep.is-armed .kt-check::after { opacity: 0; }
.kt-prep.is-armed li.is-on .kt-check { background: var(--ok); border-color: var(--ok); transform: scale(1.08); }
.kt-prep.is-armed li.is-on .kt-check::after { opacity: 1; }
.kt-prep-note { margin: 20px 0 0; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--night-line); color: var(--fg-soft); font-size: 0.95rem; }

.kt-chat-col { display: grid; gap: 16px; justify-items: start; }
.kt-chat { width: 100%; overflow: hidden; border-radius: 24px; background: #0d172d; border: 1px solid var(--line); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7); }
.kt-chat-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--night-2); border-bottom: 1px solid var(--line); }
.kt-chat-top img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; filter: grayscale(1); }
.kt-chat-top b { display: block; font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.kt-chat-top small { display: block; color: var(--fg-soft); font-size: 0.8rem; }
.kt-chat-body { display: grid; gap: 12px; align-content: start; min-height: 250px; padding: 20px 18px; background-image: radial-gradient(rgba(170, 181, 207, 0.07) 1px, transparent 1px); background-size: 18px 18px; }
.kt-msg { max-width: 88%; padding: 10px 14px 8px; border-radius: 18px; font-size: 0.95rem; line-height: 1.45; }
.kt-msg p { margin: 0 0 3px; }
.kt-msg--out { justify-self: end; background: #2a4fb8; color: #fff; border-bottom-right-radius: 6px; }
.kt-msg--in { justify-self: start; background: var(--night-3); border-bottom-left-radius: 6px; }
.kt-msg-meta { display: block; text-align: right; font-size: 0.74rem; color: #d6e0ff; }
.kt-msg--in .kt-msg-meta { color: var(--fog); }
.kt-typing { justify-self: start; display: none; gap: 5px; padding: 13px 16px; border-radius: 18px 18px 18px 6px; background: var(--night-3); }
.kt-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--fog); animation: kt-dot 1s ease-in-out infinite; }
.kt-typing i:nth-child(2) { animation-delay: 0.15s; }
.kt-typing i:nth-child(3) { animation-delay: 0.3s; }
.kt-chat.is-typing .kt-typing { display: inline-flex; }
@keyframes kt-dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-4px); opacity: 1; } }
.kt-chat-cap { margin: 0; padding: 10px 18px 14px; color: var(--fg-dim); font-size: var(--step--1); }

/* ---------- адаптив ---------- */
@media (max-width: 1080px) {
  .kt-clock { max-width: 420px; margin-inline: auto; }
  .kt-prep-grid { grid-template-columns: 1fr; }
  .kt-chat-col { max-width: 560px; }
}
@media (max-width: 640px) {
  .kt-ch { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; min-height: 70px; padding: 12px 14px; }
  .kt-ch-ico { width: 44px; height: 44px; border-radius: 14px; }
  .kt-ch-act { display: none; }
  .kt-status { padding: 10px 14px; }
  .kt-hours th { font-size: 0.95rem; }
  .kt-msg { max-width: 94%; font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
  .onair-dot::after { display: none; }
  .kt-typing i { animation: none; }
}
