/**
 * v2 — Knowledge entity (game object) page: layout, sticky sidebar, cards, table.
 *
 * Использует общие переменные --xh-* из home.css (фон, цвета, шрифты, max-width, header-h).
 * Загружается только на /knowledge/encyclopedia/{cat}/{slug}/ (карточка одного объекта).
 *
 * Namespace: xk-entity-* (карточка игрового объекта).
 * Отличается от xh-kb-detail-* (markdown-статьи в kb-detail.css).
 *
 * @since 2026-05-25 — адаптация макета building-metal-mine.html под единый портал-слой
 */

/* ================= HERO ================= */
.xk-entity-hero {
  position: relative;
  z-index: 1;
  padding: 40px 0 0;
  overflow: hidden;
}
.xk-entity-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.xk-entity-hero-bg picture,
.xk-entity-hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .35;
}
.xk-entity-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(6,10,20,.78) 0%, rgba(6,10,20,.58) 50%, rgba(6,10,20,.45) 80%),
    linear-gradient(180deg, transparent 55%, var(--xh-bg-deep) 100%);
}
.xk-entity-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--xh-max-w);
  margin: 0 auto;
  padding: 0 var(--xh-container-pad);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: center;
}
.xk-entity-hero-left { max-width: 580px; }
.xk-entity-hero-inner .xh-breadcrumbs { margin-bottom: 14px; }

.xk-entity-hero-title {
  font-family: var(--xh-font-display);
  font-size: clamp(30px, 4vw, 44px);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.05;
  margin: 0 0 12px;
}
.xk-entity-hero-desc {
  font-size: 15px;
  color: var(--xh-text-secondary);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 500px;
}

/* Fact cards row */
.xk-entity-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.xk-entity-fact {
  padding: 12px 14px;
  border-radius: var(--xh-radius);
  border: 1px solid var(--xh-border-light);
  background: rgba(12,19,34,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.xk-entity-fact-label {
  font-family: var(--xh-font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--xh-text-muted);
  margin-bottom: 3px;
}
.xk-entity-fact-val {
  font-family: var(--xh-font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.xk-entity-fact-val--orange { color: var(--xh-orange); }
.xk-entity-fact-val--green  { color: var(--xh-green); }
.xk-entity-fact-val--blue   { color: var(--xh-blue-light); }

/* Hero art (картинка объекта). Без подложки и фона — PNG с прозрачностью смотрится «как есть».
   Placeholder показывается только когда картинки физически нет — у него своя dashed-рамка. */
.xk-entity-hero-art {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.xk-entity-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.xk-entity-hero-art-ph {
  text-align: center;
  color: var(--xh-text-muted);
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  opacity: .5;
  padding: 24px;
}
.xk-entity-hero-art-ph::before {
  content: '';
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border: 2px dashed var(--xh-border-light);
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(232,132,30,.03) 5px, rgba(232,132,30,.03) 10px);
}

/* ================= LAYOUT ================= */
.xk-entity-layout {
  position: relative;
  z-index: 1;
  padding: 32px 0 56px;
}
.xk-entity-layout-inner {
  max-width: var(--xh-max-w);
  margin: 0 auto;
  padding: 0 var(--xh-container-pad);
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}
.xk-entity-main { min-width: 0; }

/* Content section card */
.xk-entity-section {
  background: var(--xh-bg-card);
  border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius-lg);
  padding: 28px 28px;
  margin-bottom: 20px;
}
.xk-entity-section-title {
  font-family: var(--xh-font-heading);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #fff;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.xk-entity-section-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.xk-entity-section-title-icon svg { width: 14px; height: 14px; }
.xk-entity-section-title-icon--blue   { background: rgba(42,125,225,.12); border: 1px solid rgba(42,125,225,.28); color: var(--xh-blue-light); }
.xk-entity-section-title-icon--orange { background: rgba(232,132,30,.12); border: 1px solid rgba(232,132,30,.28); color: var(--xh-orange); }
.xk-entity-section-title-icon--teal   { background: rgba(32,176,184,.12); border: 1px solid rgba(32,176,184,.28); color: var(--xh-teal); }
.xk-entity-section-title-icon--green  { background: rgba(32,168,104,.12); border: 1px solid rgba(32,168,104,.28); color: var(--xh-green); }
.xk-entity-section-title-icon--purple { background: rgba(106,64,184,.12); border: 1px solid rgba(106,64,184,.28); color: var(--xh-purple); }
.xk-entity-section-title-icon--red    { background: rgba(208,80,32,.12); border: 1px solid rgba(208,80,32,.28); color: var(--xh-woa-red); }

.xk-entity-section p {
  font-size: 14px;
  color: var(--xh-text-secondary);
  line-height: 1.65;
  margin: 0 0 12px;
}
.xk-entity-section p:last-child { margin-bottom: 0; }

/* Effect cards grid */
.xk-entity-effect-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.xk-entity-effect-card {
  padding: 16px 14px;
  border-radius: var(--xh-radius);
  border: 1px solid var(--xh-border);
  background: rgba(255,255,255,.015);
  text-align: center;
  transition: border-color var(--xh-transition);
}
.xk-entity-effect-card:hover { border-color: var(--xh-border-light); }
.xk-entity-effect-label {
  font-family: var(--xh-font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--xh-text-muted);
  margin-bottom: 6px;
}
.xk-entity-effect-val {
  font-family: var(--xh-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--xh-text);
  line-height: 1.3;
}
.xk-entity-effect-val--orange { color: var(--xh-orange); }
.xk-entity-effect-val--green  { color: var(--xh-green); }
.xk-entity-effect-val--blue   { color: var(--xh-blue-light); }
/* Аутентичные цвета ресурсов из CSS игры (basa/woa.xterium.com/styles/css/style.css) */
.xk-entity-effect-val--res-metal    { color: var(--xh-res-metal); }
.xk-entity-effect-val--res-crystal  { color: var(--xh-res-crystal); }
.xk-entity-effect-val--res-deuterium{ color: var(--xh-res-deuterium); }
.xk-entity-effect-val--res-energy   { color: var(--xh-res-energy); }

/* Levels table */
.xk-entity-table-wrap {
  border-radius: var(--xh-radius);
  overflow: hidden;
  border: 1px solid var(--xh-border);
}
.xk-entity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.xk-entity-table th {
  text-align: left;
  padding: 11px 14px;
  font-family: var(--xh-font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--xh-text-muted);
  border-bottom: 1px solid var(--xh-border-light);
  background: rgba(255,255,255,.025);
}
.xk-entity-table td {
  padding: 10px 14px;
  color: var(--xh-text-secondary);
  border-bottom: 1px solid var(--xh-border);
}
.xk-entity-table tr:last-child td { border-bottom: none; }
.xk-entity-table tr:hover td { background: rgba(255,255,255,.02); }
.xk-entity-table td:first-child {
  color: var(--xh-text);
  font-weight: 600;
  font-family: var(--xh-font-heading);
}
.xk-entity-show-all {
  text-align: center;
  margin-top: 14px;
}

/* Info callout */
.xk-entity-callout {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--xh-radius);
  background: rgba(42,125,225,.04);
  border: 1px solid rgba(42,125,225,.18);
  border-left: 3px solid var(--xh-blue);
}
.xk-entity-callout-icon {
  flex-shrink: 0;
  color: var(--xh-blue-light);
  margin-top: 2px;
}
.xk-entity-callout-icon svg { width: 18px; height: 18px; }
.xk-entity-callout-body {
  font-size: 13px;
  color: var(--xh-text-secondary);
  line-height: 1.55;
}
.xk-entity-callout-body strong {
  color: var(--xh-blue-light);
  font-weight: 700;
}
.xk-entity-callout-body a {
  color: var(--xh-orange);
  text-decoration: underline;
  text-decoration-color: rgba(232,132,30,.3);
}
.xk-entity-callout-body a:hover { text-decoration-color: var(--xh-orange); }

/* Cost info list */
.xk-entity-cost-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.xk-entity-cost-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--xh-radius);
  border: 1px solid var(--xh-border);
  background: rgba(255,255,255,.015);
  font-size: 13px;
  color: var(--xh-text-secondary);
}
.xk-entity-cost-item svg {
  width: 16px;
  height: 16px;
  color: var(--xh-text-muted);
  flex-shrink: 0;
}

/* Requirements check */
.xk-entity-req-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--xh-radius);
  border: 1px solid rgba(32,168,104,.2);
  background: rgba(32,168,104,.04);
}
.xk-entity-req-check svg {
  width: 22px;
  height: 22px;
  color: var(--xh-green);
  flex-shrink: 0;
}
.xk-entity-req-check span {
  font-family: var(--xh-font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--xh-text);
}

/* Unlocks list */
.xk-entity-unlock-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xk-entity-unlock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--xh-radius);
  border: 1px solid var(--xh-border);
  font-size: 13px;
  color: var(--xh-text);
  transition: border-color var(--xh-transition), background var(--xh-transition);
}
.xk-entity-unlock-item:hover {
  border-color: var(--xh-border-light);
  background: rgba(255,255,255,.02);
}
.xk-entity-unlock-item svg {
  width: 16px;
  height: 16px;
  color: var(--xh-orange);
  flex-shrink: 0;
}

/* Similar entities grid */
.xk-entity-similar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.xk-entity-similar-card {
  background: var(--xh-bg-card);
  border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius-lg);
  padding: 18px 14px;
  text-align: center;
  transition: border-color var(--xh-transition), transform var(--xh-transition), box-shadow var(--xh-transition);
  cursor: pointer;
  display: block;
}
.xk-entity-similar-card:hover {
  border-color: var(--xh-border-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.xk-entity-similar-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42,125,225,.08);
  border: 1px solid rgba(42,125,225,.22);
}
.xk-entity-similar-icon svg {
  width: 20px;
  height: 20px;
  color: var(--xh-blue-light);
}
.xk-entity-similar-name {
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--xh-text);
  margin-bottom: 4px;
}
.xk-entity-similar-role {
  font-size: 11px;
  color: var(--xh-text-muted);
  margin-bottom: 10px;
  line-height: 1.35;
}
.xk-entity-similar-link {
  font-family: var(--xh-font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--xh-orange);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.xk-entity-similar-link svg { width: 12px; height: 12px; }

/* Related materials groups */
.xk-entity-related-group { margin-bottom: 18px; }
.xk-entity-related-group:last-child { margin-bottom: 0; }
.xk-entity-related-group-title {
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--xh-text-muted);
  margin-bottom: 6px;
}
.xk-entity-related-group-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--xh-text-muted);
  margin: 0 0 10px;
  opacity: .85;
}

/* === Bonus group cards — section «Что улучшает производство» ===
   Цвета категорий как CSS-переменные — единая точка изменения.
   Шаблон применяет class .xk-entity-bonus-group--{cat}, инстансы выставляют --bonus-accent. */
:root {
  --cat-senators:  #f1b14d;
  --cat-research:  #a0c4ff;
  --cat-alliances: #7ec1ff;
  --cat-anomalies: #7be3b1;
  --cat-boosters:  #ffd042;
  --cat-offers:    #ff8c69;
  --cat-artifacts: #d8a0ff;
  --cat-officers:  #ababab;
}
.xk-entity-bonus-group--senators  { --bonus-accent: var(--cat-senators); }
.xk-entity-bonus-group--research  { --bonus-accent: var(--cat-research); }
.xk-entity-bonus-group--alliances { --bonus-accent: var(--cat-alliances); }
.xk-entity-bonus-group--anomalies { --bonus-accent: var(--cat-anomalies); }
.xk-entity-bonus-group--boosters  { --bonus-accent: var(--cat-boosters); }
.xk-entity-bonus-group--offers    { --bonus-accent: var(--cat-offers); }
.xk-entity-bonus-group--artifacts { --bonus-accent: var(--cat-artifacts); }
.xk-entity-bonus-group--officers  { --bonus-accent: var(--cat-officers); }

.xk-entity-bonus-group {
  --bonus-accent: var(--xh-orange);
  margin-bottom: 18px;
  padding: 14px 14px 12px;
  border-radius: var(--xh-radius);
  border: 1px solid color-mix(in srgb, var(--bonus-accent) 28%, transparent);
  background: color-mix(in srgb, var(--bonus-accent) 6%, var(--xh-bg-deep));
}
.xk-entity-bonus-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -3px;
  margin-right: 6px;
  color: var(--bonus-accent);
}
.xk-entity-bonus-group:last-child { margin-bottom: 0; }
.xk-entity-bonus-group-title {
  font-family: var(--xh-font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--xh-text);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.xk-entity-bonus-group-icon {
  color: var(--bonus-accent);
}
.xk-entity-bonus-group-icon svg { width: 18px; height: 18px; }
.xk-entity-bonus-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  color: var(--bonus-accent);
  background: color-mix(in srgb, var(--bonus-accent) 18%, transparent);
}
/* Описание категории — менее заметное, второстепенное.
   Wave 720 a11y: opacity .55 убран (WCAG AA fail), цвет с достаточным контрастом. */
.xk-entity-bonus-group-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--xh-text-secondary, #c5cbd6);
  margin: 0 0 12px;
  font-style: italic;
}
/* Список бонусов — компактные строки */
.xk-entity-bonus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.xk-entity-bonus-item {
  display: grid;
  grid-template-columns: 12px auto 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--bonus-accent) 14%, transparent);
}
.xk-entity-bonus-item--has-img {
  grid-template-columns: 32px auto 1fr;
}
.xk-entity-bonus-item:first-child { border-top: 0; padding-top: 4px; }
.xk-entity-bonus-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bonus-accent);
  margin: 0 auto;
  box-shadow: 0 0 6px color-mix(in srgb, var(--bonus-accent) 50%, transparent);
}
.xk-entity-bonus-item-img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bonus-accent) 12%, var(--xh-bg-deep));
  border: 1px solid color-mix(in srgb, var(--bonus-accent) 30%, transparent);
  flex: 0 0 32px;
  transition: transform .15s ease, border-color .15s ease;
}
.xk-entity-bonus-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.xk-entity-bonus-item-img:hover {
  transform: scale(1.08);
  border-color: var(--bonus-accent);
}
/* Название бонуса — главный фокус, выделено цветом и весом, ссылка только тут */
.xk-entity-bonus-item-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  color: var(--bonus-accent);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px dashed color-mix(in srgb, var(--bonus-accent) 50%, transparent);
  padding-bottom: 1px;
  transition: color .15s ease, border-color .15s ease;
}
.xk-entity-bonus-item-title:hover {
  color: var(--xh-text);
  border-bottom-color: var(--bonus-accent);
}
/* Описание бонуса — обычный текст, не ссылка */
.xk-entity-bonus-item-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--xh-text);
  opacity: .8;
}
@media (max-width: 600px) {
  .xk-entity-bonus-item {
    grid-template-columns: 12px 1fr;
    row-gap: 3px;
  }
  .xk-entity-bonus-item--has-img {
    grid-template-columns: 32px 1fr;
  }
  .xk-entity-bonus-item-title { white-space: normal; }
  .xk-entity-bonus-item-desc {
    grid-column: 2;
    margin-left: 0;
  }
}
.xk-entity-related-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.xk-entity-related-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--xh-radius);
  font-size: 13px;
  color: var(--xh-text-secondary);
  transition: color var(--xh-transition), background var(--xh-transition);
}
.xk-entity-related-link:hover {
  background: rgba(255,255,255,.03);
  color: var(--xh-text);
}
.xk-entity-related-link svg {
  width: 14px;
  height: 14px;
  color: var(--xh-text-muted);
  flex-shrink: 0;
}

/* FAQ inside entity (uses xh-faq-* if available, fallback here) */
.xk-entity-faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Утилитарные классы (заменяют повторяющиеся inline-styles в entity.php) ── */
.xh-page .xk-entity-subheading,
.xk-entity-subheading {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--xh-orange, #e8841e);
  margin: 22px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--xh-orange, #e8841e);
  line-height: 1.2;
}
.xh-page .xk-entity-section:not(.xk-entity-section--secondary) .xk-entity-subheading:first-of-type,
.xk-entity-section:not(.xk-entity-section--secondary) .xk-entity-subheading:first-of-type {
  margin-top: 4px;
}

.xk-entity-tip-list {
  margin: 0;
  padding-left: 20px;
  color: var(--xh-text-secondary);
  line-height: 1.65;
}
.xk-entity-tip-list li { margin-bottom: 6px; }
.xk-entity-tip-list strong { color: var(--xh-text); font-weight: 700; }

.xk-entity-resource-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.xk-entity-energy-icon {
  color: var(--xh-res-energy);
}

.xk-entity-meta-note {
  font-size: 13px;
  color: var(--xh-text-muted);
  margin: 0 0 14px;
}
.xk-entity-meta-note--small {
  font-size: 12px;
  margin: 8px 0 0;
}

.xk-entity-details-summary {
  cursor: pointer;
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--xh-text-muted);
  padding: 8px 0;
  letter-spacing: .3px;
}
.xk-entity-details-body {
  margin-top: 10px;
  font-size: 13px;
  color: var(--xh-text-secondary);
  line-height: 1.65;
}
.xk-entity-details-body p { margin: 0 0 10px; }
.xk-entity-details-body strong { color: var(--xh-text); font-weight: 700; }

.xk-entity-toggle-full {
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--xh-orange);
  padding: 9px 22px;
  border-radius: var(--xh-radius);
  border: 1px solid rgba(232,132,30,.3);
  background: rgba(232,132,30,.06);
  cursor: pointer;
  letter-spacing: .3px;
  text-transform: uppercase;
  transition: background var(--xh-transition), border-color var(--xh-transition);
}
.xk-entity-toggle-full:hover {
  background: rgba(232,132,30,.12);
  border-color: rgba(232,132,30,.5);
}
.xk-entity-toggle-wrap {
  margin-top: 16px;
  text-align: center;
}
.xk-entity-full-table-block {
  display: none;
  margin-top: 16px;
}
.xk-entity-full-table-block.is-open { display: block; }

.xk-entity-callout--storage {
  margin-top: 10px;
  border-left-color: var(--xh-orange);
  background: rgba(232,132,30,.04);
  border-color: rgba(232,132,30,.18);
}
/* === Cost table с иконками ресурсов в заголовке === */
/* Заголовок колонки ресурса выровнен вправо как значения в этой колонке (owner-mandate 2026-05-28). */
.xk-entity-cost-table th[scope="col"] {
  text-align: right;
}
.xk-entity-cost-table th[scope="col"]:first-child,
.xk-entity-cost-table th[scope="col"]:last-child {
  text-align: left;  /* «Уровень» и «Время» — заголовок слева как содержимое в этих колонках */
}
.xk-cost-res-th {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  width: 100%;
}
.xk-cost-res-th img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
}
.xk-cost-res-th-text {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .4px;
  color: var(--xh-text-muted);
}
.xk-entity-cost-table td.xk-cost-cell {
  font-family: var(--xh-font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 18px;
}
.xk-entity-cost-table td.xk-cost-cell--empty {
  color: var(--xh-text-muted);
  /* Wave 720: opacity убран — для пустых ячеек («—») контраст не критичен,
     но WCAG требует не использовать opacity на тексте. */
}
/* На мобильном — текст ресурса скрывается, только иконка */
@media (max-width: 600px) {
  .xk-cost-res-th-text { display: none; }
  .xk-entity-cost-table td.xk-cost-cell { padding-right: 8px; font-size: 12px; }
}

/* === Defense/Fleet stats (купола, спутник — производство штук) === */
.xk-entity-defense-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.xk-entity-defense-stat {
  padding: 14px 16px;
  border-radius: var(--xh-radius);
  background: color-mix(in srgb, var(--xh-orange) 6%, var(--xh-bg-deep));
  border: 1px solid color-mix(in srgb, var(--xh-orange) 22%, transparent);
}
.xk-entity-defense-stat-label {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 11px;
  color: var(--xh-text-muted);
  margin-bottom: 6px;
}
.xk-entity-defense-stat-val {
  font-size: 15px;
  color: var(--xh-text);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.xk-defense-res {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.xk-defense-res img { width: 18px; height: 18px; }

/* === График окупаемости по уровням === */
.xk-entity-chart-card {
  margin: 14px 0 14px;
  padding: 16px 18px 12px;
  border-radius: var(--xh-radius);
  background: color-mix(in srgb, var(--xh-orange) 4%, var(--xh-bg-deep));
  border: 1px solid color-mix(in srgb, var(--xh-orange) 22%, transparent);
  border-left: 3px solid var(--xh-orange);
}
.xk-entity-chart-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.xk-entity-chart-card-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--xh-orange) 16%, transparent);
  color: var(--xh-orange);
}
.xk-entity-chart-card-title {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 14px;
  color: var(--xh-orange);
}
.xk-entity-chart-card-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--xh-text-muted);
  margin: 0 0 10px;
}
.xk-entity-chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--xh-text);
}
.xk-entity-chart-card-legend {
  font-size: 11px;
  color: var(--xh-text-muted);
  margin: 6px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.xk-entity-chart-card-legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.xk-entity-chart-card-legend-zone {
  display: inline-block;
  width: 14px; height: 10px;
  border-radius: 3px;
  margin: 0 4px 0 14px;
}
.xk-entity-chart-card-legend-zone:first-of-type { margin-left: 0; }
.xk-entity-chart-card-legend-zone--fast { background: color-mix(in srgb, #7be3b1 30%, transparent); border: 1px solid color-mix(in srgb, #7be3b1 50%, transparent); }
.xk-entity-chart-card-legend-zone--med  { background: color-mix(in srgb, #ffd042 25%, transparent); border: 1px solid color-mix(in srgb, #ffd042 45%, transparent); }
.xk-entity-chart-card-legend-zone--long { background: color-mix(in srgb, #ff6b6b 20%, transparent); border: 1px solid color-mix(in srgb, #ff6b6b 40%, transparent); }

/* Chart canvas (для tooltip позиционирования) */
.xk-entity-chart-canvas {
  position: relative;
}
.xk-entity-chart-canvas .xk-entity-chart {
  cursor: crosshair;
}
.xk-entity-chart-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 8px 10px;
  background: var(--xh-bg-deep);
  border: 1px solid var(--xh-orange);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  z-index: 5;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px));
}
.xk-entity-chart-tooltip[hidden] { display: none; }
.xk-entity-chart-tooltip-lvl {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 700;
  color: var(--xh-orange);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.xk-entity-chart-tooltip-key { color: var(--xh-text-muted); margin-right: 4px; }

/* Inline-tiers (компактная строка вместо карточки) */
.xk-entity-formula-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--xh-text-muted);
  margin: 0 0 14px;
}
.xk-entity-formula-inline strong {
  color: var(--xh-text);
  margin-right: 4px;
}
.xk-entity-formula-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--xh-orange) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--xh-orange) 22%, transparent);
  font-size: 12px;
  white-space: nowrap;
}
.xk-entity-formula-tier-chip .xk-entity-formula-mult {
  color: var(--xh-orange);
  font-weight: 700;
}

/* === Красивый блок «Формула роста стоимости» === */
.xk-entity-formula-card {
  margin: 14px 0 16px;
  padding: 16px 18px;
  border-radius: var(--xh-radius);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--xh-orange) 8%, var(--xh-bg-deep)),
    color-mix(in srgb, var(--xh-orange) 3%, var(--xh-bg-deep)));
  border: 1px solid color-mix(in srgb, var(--xh-orange) 30%, transparent);
  border-left: 3px solid var(--xh-orange);
}
.xk-entity-formula-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.xk-entity-formula-card-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--xh-orange) 18%, transparent);
  color: var(--xh-orange);
}
.xk-entity-formula-card-title {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 13px;
  color: var(--xh-orange);
}
.xk-entity-formula-card-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
}
.xk-entity-formula-tiers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.xk-entity-formula-tiers li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--xh-orange) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--xh-orange) 26%, transparent);
  white-space: nowrap;
}
.xk-entity-formula-range {
  font-family: var(--xh-font-mono, monospace);
  font-size: 12px;
  color: var(--xh-text-muted);
}
.xk-entity-formula-mult {
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 700;
  color: var(--xh-orange);
  font-size: 15px;
}
.xk-entity-formula-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--xh-text-muted);
  opacity: .8;
}

/* === Большая таблица «Все N уровней» — улучшенный UX === */
.xk-entity-fulltable-body .xk-entity-table-wrap {
  max-height: 600px;
  max-height: min(600px, 70dvh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--xh-radius);
  border: 1px solid rgba(232, 132, 30, .18);
  border: 1px solid color-mix(in srgb, var(--xh-orange) 18%, transparent);
  background: #0c0d12;
  background: color-mix(in srgb, var(--xh-orange) 3%, var(--xh-bg-deep));
  scrollbar-width: thin;
}
.xk-entity-fulltable-body .xk-entity-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
/* Sticky header — solid fallback ПЕРЕД color-mix для Safari iOS 15.x / old Chrome */
.xk-entity-fulltable-body .xk-entity-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #1a1408;
  background: color-mix(in srgb, var(--xh-orange) 18%, var(--xh-bg-deep));
  color: var(--xh-text);
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 12px;
  padding: 10px 14px;
  box-shadow: inset 0 -2px 0 rgba(232, 132, 30, .36), 0 2px 4px rgba(0, 0, 0, .2);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--xh-orange) 36%, transparent), 0 2px 4px rgba(0, 0, 0, .2);
}
.xk-entity-fulltable-body .xk-entity-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--xh-text) 5%, transparent);
}
/* Zebra-stripes */
.xk-entity-fulltable-body .xk-entity-table tbody tr:nth-child(odd) td {
  background: color-mix(in srgb, var(--xh-orange) 3%, transparent);
}
/* Highlight каждый 10-й уровень (через CSS rule) */
.xk-entity-fulltable-body .xk-entity-table tbody tr:nth-child(10n) td {
  background: color-mix(in srgb, var(--xh-orange) 8%, transparent);
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--xh-orange) 26%, transparent);
}
.xk-entity-fulltable-body .xk-entity-table tbody tr:nth-child(10n) td:first-child {
  color: var(--xh-orange);
}
/* Hover-подсветка строки */
.xk-entity-fulltable-body .xk-entity-table tbody tr {
  transition: background .12s ease;
}
.xk-entity-fulltable-body .xk-entity-table tbody tr:hover td {
  background: color-mix(in srgb, var(--xh-orange) 14%, transparent);
}
/* Колонка «Уровень» — узкая, моноспейс для выравнивания */
.xk-entity-fulltable-body .xk-entity-table td:first-child {
  width: 60px;
  text-align: right;
  font-family: var(--xh-font-mono, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--xh-text-muted);
}
/* Колонка «Время» — моноспейс */
.xk-entity-fulltable-body .xk-entity-table td:last-child {
  font-family: var(--xh-font-mono, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--xh-text-muted);
  white-space: nowrap;
  width: 120px;
}
/* Мобильная версия — компактные колонки чтобы вся таблица влезала по экрану */
@media (max-width: 600px) {
  .xk-entity-fulltable-body .xk-entity-table { font-size: 12px; }
  .xk-entity-fulltable-body .xk-entity-table thead th { padding: 8px 6px; font-size: 10px; letter-spacing: .3px; }
  .xk-entity-fulltable-body .xk-entity-table tbody td { padding: 6px 6px; }
  .xk-entity-fulltable-body .xk-entity-table td:first-child,
  .xk-entity-fulltable-body .xk-entity-table th:first-child {
    width: 32px;
    padding-left: 8px;
    padding-right: 4px;
    font-size: 11px;
  }
  .xk-entity-fulltable-body .xk-entity-table td:last-child,
  .xk-entity-fulltable-body .xk-entity-table th:last-child {
    width: auto;
    font-size: 11px;
    padding-right: 8px;
  }
}
@media (max-width: 380px) {
  .xk-entity-fulltable-body .xk-entity-table { font-size: 11px; }
  .xk-entity-fulltable-body .xk-entity-table thead th { padding: 6px 4px; font-size: 9px; }
  .xk-entity-fulltable-body .xk-entity-table tbody td { padding: 5px 4px; }
  .xk-entity-fulltable-body .xk-entity-table td:first-child,
  .xk-entity-fulltable-body .xk-entity-table th:first-child { width: 28px; padding-left: 6px; padding-right: 2px; }
}

/* Полноценная кнопка раскрытия full-table в секциях «Сколько добывает» и «Стоимость» */
.xk-entity-fulltable-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 14px 0 0;
}
.xk-entity-fulltable-toggle {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--xh-orange) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--xh-orange) 40%, transparent);
  color: var(--xh-orange);
  font-family: var(--xh-font-heading, Rajdhani), sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.xk-entity-fulltable-toggle:hover {
  background: color-mix(in srgb, var(--xh-orange) 22%, transparent);
  border-color: var(--xh-orange);
  transform: translateY(-1px);
}
.xk-entity-fulltable-toggle svg {
  transition: transform .25s ease;
}
.xk-entity-fulltable-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.xk-entity-fulltable-body {
  margin-top: 14px;
}

/* TL;DR выжимка ключевых фактов в начале блока «Описание» */
.xk-entity-tldr {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--xh-radius);
  background: color-mix(in srgb, var(--xh-orange) 6%, var(--xh-bg-deep));
  border-left: 3px solid var(--xh-orange);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xk-entity-tldr li {
  font-size: 14px;
  line-height: 1.5;
  padding-left: 22px;
  position: relative;
}
.xk-entity-tldr li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--xh-orange);
  font-weight: 700;
}
.xk-entity-tldr strong { color: var(--xh-text); }
.xk-entity-tldr a { color: var(--xh-orange); text-decoration: none; border-bottom: 1px dashed currentColor; }
.xk-entity-tldr a:hover { color: var(--xh-text); }

.xk-entity-callout--mechanics {
  --callout-accent: var(--cat-boosters);
  margin: 0 0 16px;
  border-left-color: var(--callout-accent);
  background: color-mix(in srgb, var(--callout-accent) 6%, transparent);
  border-color: color-mix(in srgb, var(--callout-accent) 22%, transparent);
}
.xk-entity-callout--mechanics .xk-entity-callout-icon { color: var(--callout-accent); }
.xk-entity-callout--mechanics .xk-entity-callout-body strong { color: var(--callout-accent); }
.xk-entity-callout--storage .xk-entity-callout-icon { color: var(--xh-orange); }
.xk-entity-callout--storage .xk-entity-callout-body strong { color: var(--xh-orange); }

/* Energy callout — оранжевый-красный (не фиолетовый: фиолет это ТМ).
   Owner-feedback 2026-05-27: «энергия это оранжевый, чуть в красный». */
.xk-entity-callout--energy {
  --energy-color: #ff7438;
  margin-top: 16px;
  border-left-color: var(--energy-color);
  background: color-mix(in srgb, var(--energy-color) 6%, transparent);
  border-color: color-mix(in srgb, var(--energy-color) 22%, transparent);
}
.xk-entity-callout--energy .xk-entity-callout-icon {
  color: var(--energy-color);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.xk-entity-callout--energy .xk-entity-callout-icon svg + svg {
  width: 14px;
  height: 14px;
  margin-top: 4px;
}
.xk-entity-callout--energy .xk-entity-callout-body strong { color: var(--energy-color); }

.xk-entity-energy-line {
  font-size: 11px;
  color: var(--xh-text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Плашка энергии в hero — заметная, цветная по типу отношения здания к энергии. */
.xk-entity-energy-plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--xh-radius-lg);
  border: 1px solid var(--xh-border-light);
  background: rgba(12,19,34,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-top: 14px;
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
}
.xk-entity-energy-plate-icon {
  display: inline-flex;
  align-items: center;
}
.xk-entity-energy-plate-icon svg { width: 16px; height: 16px; }
.xk-entity-energy-plate--consumes {
  border-color: rgba(208,80,32,.4);
  background: rgba(208,80,32,.10);
  color: var(--xh-woa-red);
}
.xk-entity-energy-plate--none {
  border-color: rgba(32,168,104,.4);
  background: rgba(32,168,104,.10);
  color: var(--xh-green);
}
.xk-entity-energy-plate--produces {
  border-color: rgba(145,51,153,.4);
  background: rgba(145,51,153,.10);
  color: var(--xh-res-energy);
}
.xk-entity-energy-plate--fuel {
  border-color: rgba(42,125,225,.4);
  background: rgba(42,125,225,.10);
  color: var(--xh-blue-light);
}

.xk-entity-bonuses-fallback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--xh-radius);
  border: 1px dashed var(--xh-border-light);
  background: rgba(255,255,255,.015);
  font-size: 13px;
  color: var(--xh-text-muted);
  line-height: 1.55;
}
.xk-entity-bonuses-fallback strong { color: var(--xh-text-secondary); }

/* Data footer */
.xk-entity-data-footer {
  padding: 14px 0;
  font-size: 12px;
  color: var(--xh-text-muted);
  border-top: 1px solid var(--xh-border);
  margin-top: 8px;
}

/* ================= SIDEBAR ================= */
.xk-entity-sidebar {
  position: sticky;
  top: calc(var(--xh-header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.xk-entity-sidebar-card {
  background: var(--xh-bg-card);
  border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius-lg);
  padding: 20px;
}
.xk-entity-sidebar-title {
  font-family: var(--xh-font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #fff;
  margin: 0 0 14px;
}

/* Sidebar nav (scroll-spy nav, как в макете) */
.xk-entity-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.xk-entity-nav-link {
  display: block;
  padding: 7px 12px;
  border-radius: var(--xh-radius);
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--xh-text-secondary);
  letter-spacing: .2px;
  transition: color var(--xh-transition), background var(--xh-transition), border-color var(--xh-transition);
  border-left: 3px solid transparent;
}
.xk-entity-nav-link:hover {
  color: var(--xh-text);
  background: rgba(255,255,255,.03);
}
.xk-entity-nav-link.is-active {
  color: var(--xh-orange);
  border-left-color: var(--xh-orange);
  background: rgba(232,132,30,.06);
}

.xk-entity-sidebar-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--xh-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--xh-orange);
  padding: 10px 0;
  transition: color var(--xh-transition);
}
.xk-entity-sidebar-back:hover { color: var(--xh-orange-hover); }
.xk-entity-sidebar-back svg { width: 14px; height: 14px; }

.xk-entity-sidebar-cat-label {
  font-size: 12px;
  color: var(--xh-text-muted);
  margin-bottom: 4px;
}
.xk-entity-sidebar-cat-val {
  font-family: var(--xh-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--xh-text);
}

/* CTA sidebar card */
.xk-entity-sidebar-cta {
  background: linear-gradient(135deg, rgba(232,132,30,.06) 0%, rgba(208,80,32,.08) 100%);
  border-color: rgba(232,132,30,.18);
}
.xk-entity-sidebar-cta .xk-entity-sidebar-title {
  font-size: 13px;
  margin-bottom: 8px;
}
.xk-entity-sidebar-cta-desc {
  font-size: 12px;
  color: var(--xh-text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.xk-entity-sidebar-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xk-entity-sidebar-cta-actions .xh-btn {
  justify-content: center;
  font-size: 12px;
  padding: 8px 14px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .xk-entity-hero-inner { grid-template-columns: 1fr 280px; gap: 28px; }
  .xk-entity-similar-grid { grid-template-columns: repeat(2, 1fr); }
  .xk-entity-effect-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .xk-entity-hero { padding-top: 32px; }
  .xk-entity-hero-inner {
    padding: 0 20px;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .xk-entity-hero-art {
    max-width: 280px;
    aspect-ratio: 1;
    margin: 0 auto;
  }
  .xk-entity-hero-art img { max-width: 100%; height: auto; }
  /* Mobile: hero-bg galaxy картинка становится почти-незаметной
     чтобы не «висела на пол экрана» при высоком стеке контента. */
  .xk-entity-hero-bg img { opacity: .12; }
  .xk-entity-hero-bg::after {
    background:
      linear-gradient(180deg, rgba(6,10,20,.85) 0%, rgba(6,10,20,.92) 30%, var(--xh-bg-deep) 100%);
  }
  .xk-entity-facts { grid-template-columns: repeat(2, 1fr); }
  .xk-entity-layout { padding: 24px 0 48px; }
  .xk-entity-layout-inner {
    padding: 0 20px;
    grid-template-columns: 1fr;
  }
  .xk-entity-sidebar {
    position: static;
    /* order: -1 убран — sidebar идёт после контента на мобильном,
       чтобы пользователь сразу видел числа а не 10 anchor-ссылок (owner-feedback). */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
  }
  .xk-entity-sidebar-card:first-child { grid-column: 1 / -1; }
  .xk-entity-section { padding: 22px 20px; }
  .xk-entity-similar-grid { grid-template-columns: repeat(2, 1fr); }
  .xk-entity-table-wrap { overflow-x: auto; }
}

@media (max-width: 480px) {
  .xk-entity-hero-inner { padding: 0 16px; }
  .xk-entity-layout-inner { padding: 0 16px; }
  .xk-entity-facts { grid-template-columns: 1fr 1fr; }
  .xk-entity-effect-grid { grid-template-columns: 1fr 1fr; }
  .xk-entity-similar-grid { grid-template-columns: 1fr 1fr; }
  .xk-entity-sidebar { grid-template-columns: 1fr; }
  .xk-entity-section { padding: 18px 16px; }
  .xk-entity-hero-art { max-width: 240px; }
  /* Bonus link на узких экранах — компактнее */
  .xk-entity-bonus-group { padding: 12px 12px 10px; }
  .xk-entity-bonus-group-icon { flex: 0 0 32px; width: 32px; height: 32px; }
  .xk-entity-bonus-link { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .xk-entity-fulltable-toggle:hover,
  .xk-entity-bonus-item-img:hover,
  .xk-entity-similar-card:hover,
  .xk-entity-effect-card:hover,
  .xk-entity-unlock-item:hover {
    transform: none;
  }
}

/* === A11y: видимая рамка фокуса для всех интерактивных элементов === */
.xk-entity-fulltable-toggle:focus-visible,
.xk-entity-nav-link:focus-visible,
.xk-entity-similar-card:focus-visible,
.xk-entity-related-link:focus-visible,
.xk-entity-bonus-link:focus-visible,
.xk-entity-bonus-item-title:focus-visible,
.xk-entity-bonus-item-img:focus-visible,
.xk-cat-filter-tab:focus-visible,
.xk-cat-card:focus-visible,
.xk-entity-toggle-full:focus-visible,
.xk-entity-chart:focus-visible,
.xh-faq-q:focus-visible {
  outline: 2px solid var(--xh-orange, #e8841e);
  outline-offset: 2px;
  border-radius: var(--xh-radius, 6px);
}

/* === Wave 720 (2026-05-28) — классы взамен inline-styles в partials === */
.xk-entity-link-accent { color: var(--xh-orange, #e8841e); }
.xk-entity-link-accent:hover { color: var(--xh-orange, #e8841e); opacity: .85; }
.xk-entity-unlock-lvl { color: var(--xh-text, #fff); }
.xk-entity-meta-note--top-spaced { margin-top: 10px; }
.xk-entity-compare-desc {
  font-size: 14px;
  color: var(--xh-text-secondary, #c5cbd6);
  line-height: 1.6;
  margin: 0;
}
.xk-entity-related-link-title { color: var(--xh-text, #fff); }
.xk-entity-related-link-meta {
  color: var(--xh-text-muted, #9aa3b2);
  font-size: 12px;
  margin-left: 6px;
}

/* Wave 720: sidebar back-link wrap (вместо inline style margin-top:14px) */
.xk-entity-sidebar-back-wrap { margin-top: 14px; }
/* Wave 720: footer data note (вместо inline style margin-top:6px;font-size:11px;opacity:.85) */
.xk-entity-data-footer-note { margin-top: 6px; font-size: 11px; opacity: .85; }
/* Wave 720: fulltable wrap top spacing (was inline style margin-top:18px) */
.xk-entity-fulltable-wrap--cost { margin-top: 18px; }

/* Wave 720: TL;DR-блок hero (AEO-friendly «Кратко:» префикс). */
.xk-entity-tldr-marker {
  color: var(--xh-orange, #e8841e);
  margin-right: 4px;
  font-weight: 700;
}
.xk-entity-hero-desc--secondary {
  font-size: 14px;
  color: var(--xh-text-secondary, #c5cbd6);
}
