/* Строка связи внизу и окно «Связь с сервисом» (netline.js). Цвета и кривые — переменные Хасана из style.css. */

.nl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ——— Тон состояния: слово, значок и точка одного цвета ——— */
.nl-line, .nl-panel { --nl-ink: var(--ink-2); --nl-dot: var(--ink-3); }
.nl-line[data-state="ok"], .nl-panel[data-state="ok"] { --nl-ink: var(--good-ink); --nl-dot: var(--good); }
.nl-line[data-state="slow"], .nl-panel[data-state="slow"] { --nl-ink: var(--warning-ink); --nl-dot: var(--warning); }
.nl-line[data-state="phone"], .nl-panel[data-state="phone"] { --nl-ink: var(--serious-ink); --nl-dot: var(--serious); }
.nl-line[data-state="down"], .nl-panel[data-state="down"] { --nl-ink: var(--critical-ink); --nl-dot: var(--critical); }
.nl-line[data-state="send"], .nl-panel[data-state="send"] { --nl-ink: var(--accent-ink); --nl-dot: var(--accent); }

/* ——— Строка: на телефоне над нижним меню, на компьютере у нижнего края основного столбца ———
 * Пока связь есть, она тихая и серая; при сбое окрашивается и справа появляется «Что делать». */
.nl-line {
  position: sticky;
  z-index: 46;
  /* Над нижним меню Хасана (58 px); чужая страница задаёт высоту своего меню через --nl-bottom. */
  bottom: var(--nl-bottom, calc(58px + var(--safe-bottom)));
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 16px;
  border: 0;
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line-soft);
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nl-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--nl-dot); transition: background-color 240ms var(--ease); }
.nl-word { font-weight: 650; color: var(--nl-ink); white-space: nowrap; }
.nl-detail { min-width: 0; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-detail:empty { display: none; }
.nl-more { margin-left: auto; flex: none; color: var(--accent-ink); font-weight: 600; }
.nl-line[data-state="ok"] .nl-word, .nl-line[data-state="unknown"] .nl-word { color: var(--ink-2); font-weight: 500; }
.nl-line[data-state="ok"] .nl-more, .nl-line[data-state="unknown"] .nl-more { display: none; }
.nl-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .nl-line:hover .nl-more, .nl-line[data-state="ok"]:hover .nl-word { text-decoration: underline; text-underline-offset: 3px; }
}
/* На выдаче по QR свой значок связи в шапке: строку там не показываем. */
body:has(#view-scan.active) .nl-line { display: none; }

/* Строка выше панели «Отправить» и нижнего меню: им и отступу страницы +32 px. */
body.has-netline .submit-dock { bottom: calc(58px + 32px + var(--safe-bottom)); }
body.has-netline main { padding-bottom: 242px; }
@media (min-width: 1040px) {
  .nl-line { bottom: var(--nl-bottom-wide, 0px); }
  body.has-netline .submit-dock { bottom: 32px; }
  body.has-netline main { padding-bottom: 152px; }
}

/* ——— Окно: на телефоне шторка снизу, на компьютере окошко над строкой ——— */
.nl-backdrop { position: fixed; inset: 0; z-index: 94; background: rgb(0 0 0 / .32); opacity: 0; transition: opacity 240ms var(--ease); }
.nl-backdrop.on { opacity: 1; }
.nl-backdrop[hidden], .nl-panel[hidden] { display: none; }
.nl-panel {
  position: fixed;
  z-index: 95;
  display: grid;
  gap: 14px;
  padding: 16px 16px 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 15px;
  line-height: 1.4;
}
@media (max-width: 1039px) {
  .nl-panel { left: 0; right: 0; bottom: 0; max-height: 88dvh; border-radius: var(--radius) var(--radius) 0 0; padding-bottom: calc(12px + var(--safe-bottom)); transform: translateY(100%); transition: transform 320ms var(--ease-drawer); touch-action: pan-y; }
  .nl-panel.on { transform: translateY(var(--drag, 0px)); }
  .nl-panel.dragging { transition: none; }
  .nl-panel::before { content: ""; justify-self: center; width: 36px; height: 4px; margin: -6px 0; border-radius: 2px; background: var(--line); }
}
@media (min-width: 1040px) {
  .nl-backdrop { display: none !important; }
  .nl-panel { width: 400px; max-height: min(680px, calc(100dvh - 32px)); border: 1px solid var(--line-soft); border-radius: var(--radius); opacity: 0; transform: translateY(6px) scale(.98); transform-origin: bottom right; transition: opacity 150ms var(--ease), transform 240ms var(--ease); }
  .nl-panel.on { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nl-panel, .nl-panel.on { transform: none; }
}

.nl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-right: -8px; }
.nl-head h2 { margin: 0; font-size: 17px; font-weight: 650; }
.nl-close { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.nl-close svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .nl-close:hover { background: var(--surface-2); color: var(--ink); } }

.nl-now { display: flex; align-items: center; gap: 12px; }
.nl-now-ic { color: var(--nl-ink); line-height: 0; }
.nl-now-ic svg { width: 30px; height: 30px; }
.nl-now-text { display: grid; gap: 2px; min-width: 0; }
.nl-now-word { font-size: 22px; line-height: 1.15; font-weight: 700; color: var(--nl-ink); }
.nl-now-verdict { font-weight: 600; }

/* Проверка трёх звеньев: «звено слева, ответ справа», ответ цветом. */
.nl-checks { list-style: none; margin: -4px 0 0; padding: 0; }
.nl-checks li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.nl-checks li:last-child { border-bottom: 0; }
.nl-cdot { width: 8px; height: 8px; flex: none; align-self: center; border-radius: 50%; background: var(--ink-3); }
.nl-cname { flex: none; white-space: nowrap; }
.nl-cval { flex: 1 1 auto; min-width: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.nl-checks li[data-tone="muted"] .nl-cval { font-weight: 500; }
.nl-checks li[data-tone="good"] .nl-cdot { background: var(--good); }
.nl-checks li[data-tone="good"] .nl-cval { color: var(--good-ink); }
.nl-checks li[data-tone="warning"] .nl-cdot { background: var(--warning); }
.nl-checks li[data-tone="warning"] .nl-cval { color: var(--warning-ink); }
.nl-checks li[data-tone="critical"] .nl-cdot { background: var(--critical); }
.nl-checks li[data-tone="critical"] .nl-cval { color: var(--critical-ink); }

.nl-todo { margin: 0; line-height: 1.45; }
.nl-waiting { margin: -6px 0 0; font-size: 13px; color: var(--ink-2); }
.nl-support:empty { display: none; }
.nl-group { display: grid; gap: 8px; }
.nl-group-title { margin: 0; font-size: 13px; font-weight: 640; color: var(--ink-2); }

/* Контакт: имя слева, телефон справа; ниже круглые знаки, как обычно у нас (сайт WashBar):
 * звонок, Telegram на фирменном синем, Макс на фирменном градиенте. */
.nl-person { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.nl-person span { color: var(--ink-2); }
.nl-phone { margin-left: auto; font-weight: 650; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nl-acts { display: flex; gap: 22px; padding-top: 2px; }
.nl-act { display: grid; justify-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.nl-act-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; transition: transform 120ms var(--ease); }
.nl-act-ic svg { width: 22px; height: 22px; }
.nl-act-call { background: var(--accent); }
.nl-act-call svg { width: 20px; height: 20px; }
.nl-act-tg { background: #1a7abf; }
.nl-act-max { background: linear-gradient(135deg, #2B7FFF 0%, #8A5CFF 100%); }
.nl-act-max svg { width: 23px; height: 23px; }
.nl-act:active .nl-act-ic { transform: scale(.94); }
.nl-when { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }

.nl-legend { list-style: none; margin: 0; padding: 0; }
.nl-legend li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.nl-ldot { width: 8px; height: 8px; flex: none; align-self: center; border-radius: 50%; }
.nl-legend b { flex: none; font-weight: 600; }
.nl-legend span { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--ink-2); }
.nl-legend li[aria-current="true"] span { color: var(--ink); font-weight: 600; }
.nl-legend li[data-state="ok"] b { color: var(--good-ink); }
.nl-legend li[data-state="ok"] .nl-ldot { background: var(--good); }
.nl-legend li[data-state="slow"] b { color: var(--warning-ink); }
.nl-legend li[data-state="slow"] .nl-ldot { background: var(--warning); }
.nl-legend li[data-state="phone"] b { color: var(--serious-ink); }
.nl-legend li[data-state="phone"] .nl-ldot { background: var(--serious); }
.nl-legend li[data-state="down"] b { color: var(--critical-ink); }
.nl-legend li[data-state="down"] .nl-ldot { background: var(--critical); }
.nl-legend li[data-state="send"] b { color: var(--accent-ink); }
.nl-legend li[data-state="send"] .nl-ldot { background: var(--accent); }

.nl-foot { display: flex; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.nl-recheck { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--accent-ink); cursor: pointer; }
.nl-recheck svg { width: 18px; height: 18px; }
.nl-recheck[data-state="busy"] svg { animation: nl-spin .8s linear infinite; }
@keyframes nl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .nl-recheck[data-state="busy"] svg { animation: none; opacity: .45; } }
