/* Раздел «Сетевые компании» и переключатель справочников.
   Подключается в base.html только на /network и /projects.

   Цвет итога везде один и тот же: зелёный — лидер подтверждён, янтарный —
   вероятный, синий — участник, серый — мало данных, оранжевый — ИИ не смог
   оценить, красный — не та компания, сиреневый — организация. Цвет никогда не единственный носитель
   смысла: рядом всегда значок и слово (или title у плотных мест). */

:root {
  --v-ok: var(--t-success);
  --v-warn: var(--t-warning);
  --v-info: var(--t-info);
  --v-none: var(--t-muted-foreground);
  --v-bad: var(--t-destructive);
  --v-org: 268 55% 66%;
  --v-fail: 24 90% 60%;
  --nx-ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="light"] {
  --v-org: 268 45% 52%;
  --v-fail: 24 85% 45%;
}

.v-ok   { --v: var(--v-ok); }
.v-warn { --v: var(--v-warn); }
.v-info { --v: var(--v-info); }
.v-none { --v: var(--v-none); }
.v-bad  { --v: var(--v-bad); }
.v-org  { --v: var(--v-org); }
.v-fail { --v: var(--v-fail); }

.is-ok   { color: hsl(var(--v-ok)); }
.is-warn { color: hsl(var(--v-warn)); }
.is-flat { color: var(--muted); }

/* --- переключатель справочников ------------------------------------------ */
.nx-seg {
  display: inline-flex; gap: 2px; padding: 3px; margin-bottom: var(--sp-6);
  background: var(--tint); border: 1px solid var(--line); border-radius: 10px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.nx-seg a {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 7px; color: var(--muted); font-size: var(--s1); font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--nx-ease), color .15s var(--nx-ease);
}
.nx-seg a:hover { color: var(--text); }
.nx-seg a.is-on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px hsl(var(--t-scrim) / .18); }
.nx-seg a.is-on .icon { color: var(--accent); }

/* --- общие мелочи --------------------------------------------------------- */
.nx-h {
  display: flex; align-items: center; gap: 8px; margin: 0 0 var(--sp-3);
  font-size: var(--s2); font-weight: 600; color: var(--text); letter-spacing: -0.01em;
}
.nx-h .icon { color: var(--accent); }
.nx-block + .nx-block { margin-top: var(--sp-8); }

.nx-flag {
  display: inline-block; flex: none; border-radius: 3px; object-fit: cover; vertical-align: middle;
  box-shadow: 0 0 0 1px hsl(var(--t-foreground) / .12);
}
.nx-flag-none { display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--muted); box-shadow: none; }
.nx-flags { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.nx-mono {
  --s: 32px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--s); height: var(--s); border-radius: calc(var(--s) * .28);
  font-size: calc(var(--s) * .38); font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  color: hsl(var(--h) 38% 34%); background: hsl(var(--h) 38% 91%);
}
:root:not([data-theme="light"]) .nx-mono { color: hsl(var(--h) 55% 78%); background: hsl(var(--h) 25% 20%); }
/* Лого проекта: картинка в той же рамке, что и буквы; белая подложка —
   прозрачные значки сайтов на тёмной теме иначе пропадают. */
img.nx-logo { box-sizing: border-box; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: calc(var(--s) * .06); }
:root:not([data-theme="light"]) img.nx-logo { background: #fff; }

.nx-verdict {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px;
  border-radius: 999px; font-size: var(--s0); font-weight: 600; white-space: nowrap;
  color: hsl(var(--v)); background: hsl(var(--v) / .12); border: 1px solid hsl(var(--v) / .22);
}
.nx-vdot {
  --s: 28px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  color: hsl(var(--v)); background: hsl(var(--v) / .14);
}
.nx-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: var(--s0); font-weight: 500; white-space: nowrap;
  color: hsl(var(--v)); background: hsl(var(--v) / .1);
}
.nx-tag.plain { color: var(--muted); background: var(--tint); }

.nx-target { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.nx-target .icon { flex: none; }
.nx-target.is-ok .icon { color: hsl(var(--v-ok)); }
.nx-target.is-other .icon { color: hsl(var(--v-warn)); }
.nx-target.is-unknown { opacity: .75; }
.nx-target.is-unknown .icon { color: var(--muted); }

.nx-when { display: inline-flex; align-items: center; gap: 4px; font-size: var(--s1); white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.nx-when.is-now { color: hsl(var(--v-ok)); font-weight: 600; }

.nx-count {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 6px;
  font-size: var(--s0); font-weight: 600; color: var(--accent); background: var(--accent-tint);
  font-variant-numeric: tabular-nums;
}

.nx-life { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nx-life.is-on { background: hsl(var(--v-ok)); box-shadow: 0 0 0 3px hsl(var(--v-ok) / .18); }
.nx-life.is-off { background: hsl(var(--v-bad)); box-shadow: 0 0 0 3px hsl(var(--v-bad) / .18); }

/* --- полоса итогов и легенда ---------------------------------------------- */
.nx-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--tint); }
.nx-bar > span { display: block; min-width: 4px; background: hsl(var(--v)); }
.nx-bar-thin { height: 6px; }
.nx-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); }
.nx-key {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  font-size: var(--s1); color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: border-color .15s var(--nx-ease), background-color .15s var(--nx-ease);
}
.nx-key i { width: 8px; height: 8px; border-radius: 2px; background: hsl(var(--v)); flex: none; }
.nx-key b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
a.nx-key:hover { border-color: hsl(var(--v) / .5); color: var(--text); }
a.nx-key.is-on { border-color: hsl(var(--v) / .6); background: hsl(var(--v) / .1); color: var(--text); }

/* --- кольцо --------------------------------------------------------------- */
.nx-donut { flex: none; }
.nx-donut circle { fill: none; stroke-width: 5.2; }
.nx-donut .nx-donut-track { stroke: var(--tint); }
.nx-donut circle[class^="v-"] { stroke: hsl(var(--v)); }
.nx-donut-n { font-size: 9px; font-weight: 700; fill: var(--text); text-anchor: middle; letter-spacing: -0.03em; }
.nx-donut-l { font-size: 3.4px; fill: var(--muted); text-anchor: middle; }

/* --- справочник: панель вкладок и поиска ---------------------------------- */
.nx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.nx-tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.nx-tabs a {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid transparent; color: var(--muted);
  font-size: var(--s1); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--nx-ease), color .15s var(--nx-ease);
}
.nx-tabs a b { font-weight: 600; color: var(--text); opacity: .7; font-variant-numeric: tabular-nums; }
.nx-tabs a:hover { background: var(--tint); color: var(--text); }
.nx-tabs a.is-on { background: var(--card); border-color: var(--line); color: var(--text); box-shadow: 0 1px 2px hsl(var(--t-scrim) / .12); }
.nx-tabs a.is-on b { opacity: 1; }
.nx-tab-ic-active { color: hsl(var(--v-ok)); }
.nx-tab-ic-historical { color: hsl(var(--v-warn)); }
.nx-tab-ic-checked, .nx-tab-ic-review { color: var(--muted); }

.nx-search { position: relative; flex: 1 1 280px; max-width: 460px; margin-left: auto; }
.nx-search .nx-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.nx-search input { width: 100%; height: 38px; padding-left: 36px; border-radius: 10px; }

/* --- «Уже искали» --------------------------------------------------------- */
.nx-work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); }
.nx-work {
  display: flex; flex-direction: column; gap: 14px; padding: var(--sp-4);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  color: inherit; text-decoration: none;
  transition: border-color .18s var(--nx-ease), box-shadow .18s var(--nx-ease);
}
.nx-work:hover { color: inherit; border-color: hsl(var(--t-primary) / .45); box-shadow: 0 6px 20px -8px hsl(var(--t-scrim) / .35); }
.nx-work-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.nx-work-name { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.nx-work-name b { font-size: var(--s2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-go { color: var(--muted); transition: transform .18s var(--nx-ease), color .18s var(--nx-ease); }
.nx-work:hover .nx-go { color: var(--accent); transform: translateX(3px); }
.nx-work-stats { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--s1); }
.nx-work-stats > span[class^="v-"] { display: inline-flex; align-items: center; gap: 4px; color: hsl(var(--v)); }
.nx-work-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.nx-work-total { margin-left: auto; color: var(--muted); }

/* --- справочник: сетка компаний ------------------------------------------- */
.nx-cat-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.nx-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 var(--sp-3); font-size: var(--s0); color: var(--muted); }
.nx-keys > span { display: inline-flex; align-items: center; gap: 5px; }

.nx-az {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--sp-2)) var(--sp-4); padding: 6px var(--sp-2);
  background: hsl(var(--t-background) / .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nx-az a {
  /* Буквы делят строку поровну: латиница и кириллица в одну линию, а не «У Ф Э #» хвостом на второй. */
  flex: 1 0 22px; max-width: 34px; display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 2px;
  border-radius: 6px; font-size: var(--s0); font-weight: 600; color: var(--muted); text-decoration: none;
}
.nx-az a:hover { background: var(--tint); color: var(--text); }
.nx-az-sep { flex: none; width: 1px; height: 18px; margin: 5px 6px; background: var(--line); }
.nx-az::-webkit-scrollbar { display: none; }

.nx-letter { content-visibility: auto; contain-intrinsic-size: auto 400px; scroll-margin-top: 56px; }
.nx-letter + .nx-letter { margin-top: var(--sp-6); }
.nx-letter-h {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 var(--sp-2);
  font-size: var(--s3); font-weight: 700; letter-spacing: -0.02em; color: var(--text);
}
.nx-letter-h span { font-size: var(--s0); font-weight: 500; color: var(--muted); }
.nx-cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.nx-co {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 52px; padding: 8px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  color: inherit; text-decoration: none;
  transition: border-color .15s var(--nx-ease), background-color .15s var(--nx-ease);
}
.nx-co:hover { color: inherit; border-color: hsl(var(--t-primary) / .45); background: hsl(var(--t-primary) / .04); }
.nx-co-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.nx-co-body b { font-size: var(--s1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-co-body small { font-size: var(--s0); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-co-ic { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.nx-co-ic > span { display: inline-flex; }

.nx-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--sp-12) var(--sp-4); text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-card); }
.nx-empty p { margin: 0; }
.nx-empty b { color: var(--text); }


/* --- результаты: обзор, фильтры, группы ------------------------------------ */
.nx-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--sp-4) var(--sp-6) var(--sp-6); }
.nx-overview { margin-bottom: var(--sp-4); }
.nx-overview-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.nx-overview-top .nx-h { margin: 0; }
.nx-overview .nx-bar { height: 14px; }
.nx-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.nx-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; font-size: var(--s1); color: var(--muted);
  text-decoration: none; white-space: nowrap;
  transition: border-color .15s var(--nx-ease), background-color .15s var(--nx-ease), color .15s var(--nx-ease);
}
.nx-toggle b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.nx-toggle:hover { color: var(--text); border-color: hsl(var(--t-primary) / .45); }
.nx-toggle.is-on { color: var(--text); border-color: hsl(var(--t-primary) / .6); background: var(--accent-tint); }
.nx-toggle.is-on .icon { color: var(--accent); }

.nx-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.nx-select {
  display: inline-flex; align-items: center; gap: 2px; flex: 0 1 260px; min-width: 0; height: var(--h-ctl); padding-left: 11px;
  border: 1px solid var(--line-ctl); border-radius: var(--r-ctl); background: hsl(var(--t-input) / .35);
}
.nx-select:focus-within { border-color: hsl(var(--t-ring)); box-shadow: var(--ring); }
.nx-select > .icon { flex: none; color: var(--muted); }
.nx-select select { flex: 1; min-width: 0; height: 100%; padding-left: 6px; border: 0; background-color: transparent; box-shadow: none; }
.nx-select select:focus { box-shadow: none; }
.nx-apply[hidden] { display: none; }
/* Общий скрипт панели подменяет <select> своим меню (.pick): внутри обёртки
   с иконкой кнопка меню без своей рамки, рамку рисует обёртка. */
.nx-select .pick { flex: 1; min-width: 0 !important; display: block; height: 100%; }
.nx-select .pick-btn { height: 100%; padding: 0 10px 0 6px; border: 0; background: transparent; box-shadow: none; }
.nx-select .pick-btn:hover { background: transparent; }
.pick-flag, .nx-opt-flag { flex: none; width: 18px; height: 13px; margin-right: 8px; border-radius: 2px; vertical-align: -2px; object-fit: cover; box-shadow: 0 0 0 1px hsl(var(--t-foreground) / .12); }
.pick-label .pick-flag { margin-right: 7px; }
.nx-reset { display: inline-flex; align-items: center; gap: 4px; font-size: var(--s1); color: var(--muted); text-decoration: none; padding: 0 6px; }
.nx-reset:hover { color: var(--text); }
.nx-export { margin-left: auto; }

.nx-notes { display: flex; flex-direction: column; gap: 4px; margin: 0 0 var(--sp-4); }
.nx-notes p { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--s1); color: var(--muted); }
.nx-notes .icon { flex: none; }

.nx-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.nx-group + .nx-group { margin-top: var(--sp-3); }
.nx-group > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px var(--sp-4); color: var(--text);
  font-size: var(--s2); cursor: pointer; user-select: none;
}
.nx-group > summary:hover { background: hsl(var(--t-muted) / .5); }
.nx-group[open] > summary { border-bottom: 1px solid var(--line); }
.nx-group-t { font-weight: 600; }
.nx-group-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.nx-group-chev { margin-left: auto; color: var(--muted); transition: transform .2s var(--nx-ease); }
details.nx-group[open] > summary .nx-group-chev { transform: rotate(180deg); }
details.nx-group:not([open]) > summary .nx-group-chev { transform: none; }

.nx-people { list-style: none; margin: 0; padding: 0; }
.nx-person + .nx-person { border-top: 1px solid var(--line); }
.nx-person-link {
  display: grid; align-items: center; gap: var(--sp-4);
  grid-template-columns: 36px minmax(0, 2.2fr) minmax(0, 1.3fr) 44px 86px 72px 14px;
  padding: 10px var(--sp-4); color: inherit; text-decoration: none;
  transition: background-color .12s var(--nx-ease);
}
.nx-person-link:hover { color: inherit; background: hsl(var(--t-muted) / .55); }
.nx-person-av { display: inline-flex; }
.nx-person-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nx-person-main b { font-weight: 600; font-size: var(--s2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-person-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.nx-person-sub:empty { display: none; }
.nx-rank, .nx-owner { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--s0); color: var(--muted); }
.nx-rank { color: hsl(var(--v-warn)); font-weight: 600; max-width: 100%; }
.nx-rank .icon { flex: none; }
.nx-person-co { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--s1); color: var(--muted); }
.nx-person-co span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-person-ch { display: inline-flex; gap: 6px; justify-content: flex-end; }
.nx-ch { display: inline-flex; color: hsl(var(--t-muted-foreground) / .45); }
.nx-ch.is-on { color: var(--accent); }
.nx-ch.is-maybe { color: var(--text); opacity: .7; }
.nx-person-go { transform: rotate(180deg); color: var(--muted); opacity: .6; }
.nx-person-link:hover .nx-person-go { opacity: 1; color: var(--accent); }

@media (max-width: 900px) {
  .nx-person-link { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px var(--sp-3); }
  .nx-person-av { grid-row: span 2; align-self: start; }
  .nx-person-main { grid-column: 2; }
  .nx-person-co { grid-column: 2; grid-row: 2; }
  .nx-person-geo { grid-column: 3; grid-row: 1; justify-self: end; }
  .nx-person-when { grid-column: 3; grid-row: 2; justify-self: end; }
  .nx-person-ch, .nx-person-go { display: none; }
}
@media (max-width: 720px) {
  .nx-panel { padding: var(--sp-4); }
  .nx-select { flex: 1 1 100%; }
  .nx-export { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nx-toggle, .nx-group-chev, .nx-person-link { transition: none; }
}

/* --- карточка человека и карточка компании: две колонки --------------------- */
.nx-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-6); align-items: start; }
.nx-main, .nx-side { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.nx-side { position: sticky; top: var(--sp-4); }
.nx-side .nx-panel { padding: var(--sp-4) var(--sp-4) var(--sp-4); }
.nx-full { width: 100%; justify-content: center; }
.nx-inline-note { display: flex; align-items: flex-start; gap: 6px; margin: var(--sp-3) 0 0; font-size: var(--s1); color: var(--muted); line-height: 1.45; }
.nx-inline-note .icon { flex: none; margin-top: 2px; }
.nx-nothing { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--sp-3); padding: 10px 12px; border-radius: 8px; background: var(--tint); color: var(--muted); font-size: var(--s1); }
.nx-nothing .icon { flex: none; }

.nx-hero { padding: var(--sp-6); }
.nx-hero-top { display: flex; align-items: center; gap: var(--sp-4); }
.nx-hero-id { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.nx-hero-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nx-hero-tags .nx-verdict { height: 28px; font-size: var(--s1); padding: 0 12px 0 9px; }
.nx-hero-co { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: var(--s1); font-weight: 500; color: var(--muted); text-decoration: none; }
.nx-hero-co:hover { color: var(--text); }
.nx-hero-rev { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: var(--s0); color: var(--muted); white-space: nowrap; }
.nx-reason-text, .nx-reason summary p { margin: var(--sp-4) 0 0; max-width: 75ch; font-size: var(--s2); line-height: 1.6; color: var(--text); }
.nx-retry { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: var(--sp-4) 0 0; }
.nx-retry .note { color: var(--muted); font-size: var(--s0); }
.nx-reason summary { display: block; color: inherit; font-size: inherit; cursor: pointer; }
.nx-reason:not([open]) summary p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nx-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: var(--s1); color: var(--accent); }
.nx-reason[open] .nx-more { display: none; }

.nx-facts6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
/* Карточка человека: ранг и время слева, три географии одной плиткой справа. */
.nx-facts3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: var(--sp-3); }
.nx-facts3 .nx-f-geo { grid-column: 2; grid-row: 1 / span 2; }
.nx-geo { grid-column: 2; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; margin: 8px 0 0; font-size: var(--s1); }
.nx-geo dt { color: var(--muted); }
.nx-geo dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--text); }
.nx-geo dd b { font-weight: 600; }
.nx-geo dd small { font-size: var(--s0); color: var(--muted); }
.nx-geo-q { display: inline-flex; color: var(--muted); cursor: help; }
@media (max-width: 560px) {
  .nx-facts3 { grid-template-columns: 1fr; }
  .nx-facts3 .nx-f-geo { grid-column: auto; grid-row: auto; }
  .nx-geo { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 2px; }
  .nx-geo dd { margin-bottom: 6px; }
}
.nx-f {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
  align-content: start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
}
.nx-f-ic {
  grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 10px; background: var(--tint); color: var(--muted);
}
.nx-f-ic[class*="v-"] { color: hsl(var(--v)); background: hsl(var(--v) / .12); }
.nx-f-l { font-size: var(--s0); color: var(--muted); line-height: 1.3; }
.nx-f-v { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--s2); font-weight: 600; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.nx-f-s { grid-column: 2; margin-top: 4px; font-size: var(--s0); line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.nx-f-q { display: block; font-style: italic; }
.nx-f-q .icon { vertical-align: -1px; margin-right: 3px; font-style: normal; }
.nx-f-q a { color: var(--accent); }
.nx-f.is-empty .nx-f-v { color: var(--muted); font-weight: 500; }
.nx-f.is-empty .nx-f-ic { opacity: .6; }

.nx-checks { background: hsl(var(--v-warn) / .08); border: 1px solid hsl(var(--v-warn) / .25); border-radius: var(--r-card); }
.nx-checks summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text); font-size: var(--s1); }
.nx-checks summary > .icon:first-child { color: hsl(var(--v-warn)); }
.nx-checks summary b { font-weight: 600; color: hsl(var(--v-warn)); }
details.nx-checks[open] summary .nx-group-chev { transform: rotate(180deg); }
.nx-checks ul { margin: 0; padding: 0 14px 12px 36px; font-size: var(--s1); line-height: 1.6; color: var(--text); }

.nx-evs { list-style: none; margin: 0; padding: 0; }
.nx-ev { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--sp-3); padding-bottom: var(--sp-6); }
.nx-ev:last-child { padding-bottom: 0; }
.nx-ev:not(:last-child)::before { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--line); }
.nx-ev-dot { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--text); }
.nx-ev-body { min-width: 0; }
.nx-ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 32px; }
.nx-ev-head b { font-weight: 600; }
.nx-ev-date { display: inline-flex; align-items: center; gap: 4px; font-size: var(--s0); color: var(--muted); }
.nx-ev-open { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: var(--s1); color: var(--accent); text-decoration: none; }
.nx-ev-open:hover { text-decoration: underline; }
.nx-quote { margin: 8px 0 0; padding: 12px 14px; border: 0; border-radius: 10px; background: var(--tint); font-size: var(--s1); line-height: 1.6; color: var(--text); max-width: none; }
.nx-why { display: flex; gap: 6px; margin: 8px 0 0; font-size: var(--s1); line-height: 1.5; overflow-wrap: anywhere; }
.nx-why > .icon { flex: none; margin-top: 3px; color: hsl(var(--v-ok)); }
.nx-ev-meta { margin: 6px 0 0; font-size: var(--s0); color: var(--muted); line-height: 1.45; }

.nx-contacts { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nx-contacts li { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 8px; background: var(--tint); font-size: var(--s1); color: var(--muted); }
.nx-contacts li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-contacts li small { font-size: var(--s0); color: var(--muted); }
.nx-contacts li.is-on { background: var(--accent-tint); color: var(--text); }
.nx-contacts li.is-on .icon-channel, .nx-contacts .nx-ok { color: var(--accent); }
.nx-more-list { margin: 0 0 var(--sp-3); }
.nx-sub-h { margin: 0 0 6px; font-size: var(--s0); color: var(--muted); }
.nx-more-list > summary { padding: 4px 0; }
.nx-more-list[open] > summary { margin-bottom: var(--sp-2); }

.nx-owner-line { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--sp-3); font-size: var(--s1); color: var(--muted); }
.nx-take { margin-bottom: var(--sp-4); }
.nx-verdict-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.nx-verdict-form .field { margin: 0; }
.nx-verdict-form input[type=text], .nx-verdict-form select { width: 100%; }
.nx-vpick { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.nx-vpick legend { margin-bottom: 6px; padding: 0; }
.nx-vpick label {
  display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; font-size: var(--s1); color: var(--muted);
  transition: border-color .15s var(--nx-ease), background-color .15s var(--nx-ease), color .15s var(--nx-ease);
}
.nx-vpick label .icon { color: hsl(var(--v)); flex: none; }
.nx-vpick label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-vpick label:hover { border-color: hsl(var(--v) / .5); color: var(--text); }
.nx-vpick input { position: absolute; opacity: 0; pointer-events: none; }
.nx-vpick label:has(input:checked) { border-color: hsl(var(--v) / .7); background: hsl(var(--v) / .12); color: var(--text); }
.nx-vpick label:has(input:focus-visible) { box-shadow: var(--ring); }
.nx-draft { margin-top: var(--sp-3); }
.nx-draft textarea { width: 100%; }
.nx-draft .actions { margin-top: var(--sp-2); }
.nx-draft .draft-label { display: block; }

@media (max-width: 1180px) {
  .nx-split { grid-template-columns: minmax(0, 1fr); }
  .nx-side { position: static; }
  .nx-facts6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .nx-facts6 { grid-template-columns: 1fr; }
  .nx-hero { padding: var(--sp-4); }
  .nx-hero-top { align-items: flex-start; flex-wrap: wrap; }
  .nx-hero-rev { order: 3; flex-basis: 100%; }
}

/* --- карточка компании ------------------------------------------------------ */
.nx-split.is-solo { grid-template-columns: minmax(0, 1fr); }
/* На узком экране поиск — главное действие карточки, он первым, а не под всей историей. */
@media (max-width: 1180px) { .nx-split.is-launch .nx-side { order: -1; } }
.nx-start { display: flex; align-items: flex-start; gap: var(--sp-4); color: var(--muted); }
.nx-start p { margin: 0 0 4px; }
.nx-start b { color: var(--text); }
.nx-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 var(--sp-4); font-size: var(--s1); }
.nx-dl dt { color: var(--muted); }
.nx-dl dd { margin: 0; color: var(--text); }
@media (max-width: 560px) { .nx-dl { grid-template-columns: 1fr; gap: 2px; } .nx-dl dd { margin-bottom: 8px; } }
.nx-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.nx-sources a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--s0); color: var(--muted); text-decoration: none; }
.nx-sources a:hover { color: var(--accent); }

.nx-rows { display: flex; flex-direction: column; gap: 14px; padding: var(--sp-4) var(--sp-6); }
.nx-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.nx-row + .nx-row { padding-top: 14px; border-top: 1px solid var(--line); }
.nx-row-l { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font-size: var(--s1); color: var(--muted); }
.nx-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.nx-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; max-width: 100%; padding: 3px 10px;
  border-radius: 8px; background: var(--tint); font-size: var(--s1); color: var(--text); line-height: 1.3;
}
.nx-chip small { font-size: var(--s0); color: var(--muted); }
.nx-chip a { display: inline-flex; color: var(--muted); }
.nx-chip a:hover { color: var(--accent); }
.nx-chip.is-main { font-weight: 600; background: var(--accent-tint); }
.nx-chip.is-rank { color: hsl(var(--v-warn)); background: hsl(var(--v-warn) / .1); font-weight: 600; }
.nx-chip.is-rank small { color: inherit; opacity: .7; }

.nx-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.nx-panel-head .nx-h { margin: 0; }
.nx-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--s1); color: var(--accent); text-decoration: none; white-space: nowrap; }
.nx-link:hover { text-decoration: underline; }
.nx-found { display: flex; align-items: center; gap: var(--sp-6); }
.nx-found-body { flex: 1; min-width: 0; }
.nx-found .nx-legend { margin-top: var(--sp-3); }
.nx-faces { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nx-faces a { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; padding: 6px 2px; border-radius: 8px; color: inherit; text-decoration: none; }
.nx-faces a:hover { background: var(--tint); }
.nx-face { position: relative; display: inline-flex; }
.nx-face .nx-vdot { position: absolute; right: -8px; bottom: -4px; box-shadow: 0 0 0 2px var(--card); background: var(--card); }
.nx-face .nx-vdot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: hsl(var(--v) / .16); }
.nx-face-name { max-width: 100%; font-size: var(--s0); color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nx-runs { list-style: none; margin: 0; padding: 0; }
.nx-run { padding: 14px 0; }
.nx-run:first-child { padding-top: 0; }
.nx-run:last-child { padding-bottom: 0; }
.nx-run + .nx-run { border-top: 1px solid var(--line); }
.nx-run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nx-run-head b { font-weight: 600; }
.nx-state { display: inline-flex; align-items: center; gap: 5px; font-size: var(--s0); color: var(--muted); }
.nx-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.nx-state.is-done i { background: hsl(var(--v-ok)); }
.nx-state.is-running i, .nx-state.is-created i { background: hsl(var(--v-info)); }
.nx-state.is-stopped i { background: hsl(var(--v-warn)); }
.nx-state.is-failed i { background: hsl(var(--v-bad)); }
.nx-run-pl { display: inline-flex; gap: 6px; color: var(--muted); }
.nx-run-when { margin-left: auto; font-size: var(--s0); color: var(--muted); }
.nx-meters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.nx-meters-pl { display: inline-flex; color: var(--muted); }
.nx-meter { display: inline-flex; align-items: center; gap: 6px; font-size: var(--s0); color: var(--muted); }
.nx-meter em { font-style: normal; }
.nx-meter i { position: relative; display: block; width: 46px; height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.nx-meter s { position: absolute; inset: 0 auto 0 0; display: block; background: hsl(var(--v-ok)); border-radius: 3px; text-decoration: none; }
.nx-meter.is-short s { background: hsl(var(--v-warn)); }
.nx-meter b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.nx-run-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; font-size: var(--s1); color: var(--muted); }
.nx-run-why .icon { flex: none; }

.nx-fold { padding: 0; }
.nx-fold > summary { display: flex; align-items: center; gap: 8px; padding: 14px var(--sp-6); color: var(--text); font-size: var(--s2); font-weight: 600; }
.nx-fold > summary .icon:first-child { color: var(--muted); }
.nx-fold[open] > summary { border-bottom: 1px solid var(--line); }
details.nx-fold[open] > summary .nx-group-chev { transform: rotate(180deg); }
.nx-fold > form, .nx-fold > .nx-log { padding: var(--sp-4) var(--sp-6); }
.nx-fold > form + form { border-top: 1px solid var(--line); }
.nx-fold h3 { margin: 0 0 var(--sp-3); font-size: var(--s1); font-weight: 600; }
.nx-log { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.nx-log li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-3); font-size: var(--s1); }
.nx-log-when { color: var(--muted); font-size: var(--s0); padding-top: 2px; }
.nx-log small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--s0); overflow-wrap: anywhere; }

.nx-launch { display: flex; flex-direction: column; gap: var(--sp-3); }
.nx-launch .field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.nx-select-wide { flex: none; width: 100%; }
.nx-pl { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.nx-pl legend { margin-bottom: 6px; padding: 0; }
.nx-pl label {
  position: relative; display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; font-size: var(--s1); color: var(--muted);
  transition: border-color .15s var(--nx-ease), background-color .15s var(--nx-ease), color .15s var(--nx-ease);
}
.nx-pl label span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-pl label small { font-size: var(--s0); color: var(--muted); }
.nx-pl input { position: absolute; opacity: 0; pointer-events: none; }
.nx-pl label:hover { border-color: hsl(var(--t-primary) / .45); color: var(--text); }
.nx-pl label:has(input:checked) { border-color: hsl(var(--t-primary) / .6); background: var(--accent-tint); color: var(--text); font-weight: 600; }
.nx-pl label:has(input:checked) .icon-channel { color: var(--accent); }
.nx-pl label:has(input:focus-visible) { box-shadow: var(--ring); }
.nx-pl label.is-off { cursor: not-allowed; opacity: .5; }
.nx-pl label.is-off:hover { border-color: var(--line); color: var(--muted); }
.nx-pl-lock { flex: none; }
.nx-limits { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.nx-limits input { width: 100%; }
.nx-check { display: flex; align-items: flex-start; gap: 8px; font-size: var(--s1); line-height: 1.4; color: var(--text); }
.nx-check input { margin-top: 2px; flex: none; }

@media (max-width: 720px) {
  .nx-found { flex-direction: column; align-items: stretch; }
  .nx-found .nx-donut { align-self: center; }
  .nx-row { grid-template-columns: 1fr; gap: 6px; }
  .nx-rows { padding: var(--sp-4); }
  .nx-log li { grid-template-columns: 1fr; gap: 2px; }
  .nx-fold > summary, .nx-fold > form, .nx-fold > .nx-log { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .nx-run-when { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-seg a, .nx-key, .nx-tabs a, .nx-work, .nx-go, .nx-co { transition: none; }
  .nx-work:hover .nx-go { transform: none; }
}

@media (max-width: 720px) {
  .nx-search { max-width: none; margin-left: 0; flex-basis: 100%; }
  .nx-cgrid { grid-template-columns: 1fr; }
}

/* Чем подтверждена компания: строка со ссылкой на её сайт и цитата. */
/* Сайт и аккаунты компании: одна строка под метками, значки площадок своим цветом. */
.nx-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.nx-site, .nx-acc {
  display: inline-flex; align-items: center; justify-content: center; height: 28px;
  border-radius: 8px; background: var(--tint); text-decoration: none; transition: background .15s;
}
.nx-site { gap: 6px; padding: 0 10px; font-size: var(--s1); color: var(--text); }
.nx-site svg { color: var(--muted); }
.nx-acc { width: 28px; }
.nx-acc .icon-channel { color: hsl(var(--ch, var(--t-muted-foreground))); }
.nx-site:hover, .nx-acc:hover { background: var(--accent-tint); }
.nx-chips.is-flags { align-items: center; gap: 6px 5px; }
.nx-geo-flag { display: inline-flex; min-height: 28px; align-items: center; }
.nx-geo-n { margin-left: 6px; font-size: var(--s0); color: var(--muted); white-space: nowrap; }

.nx-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; font-size: var(--s1); color: var(--text); }
.nx-proof > svg { color: var(--ok, #2f7d32); flex: none; }
.nx-proof a { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); text-decoration: none; }
.nx-proof.is-none, .nx-proof.is-wait { color: var(--muted); }
.nx-proof.is-wait > svg { color: var(--warn, #9a6b00); }
.nx-proof-q { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: var(--s0); line-height: 1.5; }
.nx-inline-form { display: inline; margin: 0; }
.nx-inline-form .button { display: inline-flex; align-items: center; gap: 6px; }
.nx-lead-pl { margin: 0 0 var(--sp-3); }
.nx-lead-pl .channels { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.nx-contacts li a { color: inherit; text-decoration: none; }
.nx-contacts li a:hover { color: var(--accent); text-decoration: underline; }
