/* ==========================================================================
   u-mo.ru — Единая оптимизированная таблица стилей (GPU / CPU / FAQ)
   Темы: Океан (по умолчанию), Чёрно-белая, Светлая, Фиолетовая, Зелёная
   ========================================================================== */

/* 1. Базовые переменные (тема «Океан» по умолчанию) */
:root {
  --bg: #07111f;
  --bg-page: radial-gradient(ellipse at 50% 0%, #102b47 0%, #07111f 58%);
  --topbar-bg: #071321ef;
  --panel: #0d1b2d;
  --panel2: #10233a;
  --panel-bg: linear-gradient(180deg, #0e1e31f5, #0a1726f5);
  --line: #203b58;
  --text: #eaf4ff;
  --muted: #8fa9c4;
  --cyan: #42d9f5;
  --blue: #1688d4;
  --green: #4de0ad;
  --yellow: #ffcf70;
  --accent: #42d9f5;

  /* Логотип и навигация */
  --logo-bg: linear-gradient(135deg, var(--cyan), var(--blue));
  --logo-color: #03111d;
  --logo-shadow: 0 0 24px #42d9f533;
  --burger-bg: #102238;
  --burger-line: #c7d9eb;
  --section-label: #6f91b3;
  --nav-color: #a9bfd5;
  --nav-hover-bg: #10263a;
  --nav-hover-color: #e6f6ff;
  --nav-active-bg: linear-gradient(90deg, #123d59, #102a42);
  --nav-active-border: #20516b;
  --nav-active-color: #e9fbff;

  /* Карточка помощи в сайдбаре */
  --help-bg: linear-gradient(160deg, #102b43, #0b1c2d);
  --help-border: #22506c;
  --help-title: #e4f5ff;
  --help-dot: var(--green);
  --help-dot-shadow: 0 0 10px #4de0ad99;
  --help-sub: #8fa9c4;
  --help-max-border: #5b4a8f;
  --help-max-bg: #201a35;
  --help-max-fg: #cdbbff;
  --help-tg-border: #28678b;
  --help-tg-bg: #10304a;
  --help-tg-fg: #8fd3ff;
  --help-wa-border: #2f6b5e;
  --help-wa-bg: #12332c;
  --help-wa-fg: #8fe3c3;

  /* Кнопки и выпадающий выбор темы */
  --btn-bg: #102942;
  --btn-border: #24506d;
  --btn-color: #d9f6ff;
  --btn-active-bg: #12425a;
  --btn-active-border: #36c4e7;
  --btn-active-color: #ffffff;
  --btn-primary-bg: linear-gradient(135deg, #1c9acb, #146bc2);
  --btn-primary-border: #36c4e7;
  --btn-primary-color: #ffffff;
  --login-bg: linear-gradient(135deg, #1b9ac1, #1767ad);
  --login-border: #38b7d9;

  /* Фильтры и выпадающие списки */
  --filter-bg: #0a1828;
  --filter-border: #35516b;
  --filter-text: #eaf4ff;
  --filter-arrow-base: #0b1929;
  --filter-menu-bg: #0a1726;
  --filter-menu-border-base: #263e57;
  --filter-menu-shadow: 0 12px 28px #0009;
  --filter-opt-color: #dceaf7;
  --filter-opt-hover-base: #102238;
  --filter-opt-hover-color: #ffffff;
  --brand-all: #42d9f5;
  --brand-nvidia: #719b3c;
  --brand-amd: #c85b62;
  --brand-intel: #478bbd;
  --brand-retro: #b69a67;
  --brand-fav: #d8b65d;
  --brand-fav-ghost: #e6ca77;

  /* Таблица и ячейки */
  --th-bg: #10253b;
  --th-sticky-bg: #142d45;
  --th-color: #9dbbd4;
  --th-border: #34516b;
  --th-bottom: #42617d;
  --th-inset: inset -1px 0 0 #071523;
  --td-bg: #0b1929;
  --td-alt: #0e1e30;
  --td-hover: #123149;
  --td-sticky: #10243a;
  --td-sticky-alt: #132a41;
  --td-sticky-hover: #16415b;
  --td-color: #d5e5f3;
  --td-border-r: #29435c;
  --td-border-b: #263e56;
  --drag-bg: #173b57;
  --drag-shadow: 0 -1px 0 #42d9f5, 0 1px 0 #42d9f5, 0 12px 16px -10px #000;
  --col-drag-bg: #1b4764;
  --grip-color: #5f84a3;
  --grip-hover: var(--cyan);
  --cpu-type-color: #8fb6d1;
  --selected-outline: #43d9a3;

  /* Имена брендов, значки, бейджи */
  --name-nvidia: #8cae62;
  --name-amd: #d47a7f;
  --name-intel: #72a9d0;
  --mark-bg: #163b54;
  --mark-color: var(--cyan);
  --mark-border: #245975;
  --mark-nv-bg: #1b2a1b;
  --mark-nv-color: #9dbb79;
  --mark-nv-border: #425d39;
  --mark-amd-bg: #302024;
  --mark-amd-color: #d9858a;
  --mark-amd-border: #70424a;
  --mark-in-bg: #142b3d;
  --mark-in-color: #79afd3;
  --mark-in-border: #315c7b;
  --badge-bg: #133c35;
  --badge-color: #68e4b8;
  --badge-blue-bg: #13344d;
  --badge-blue-color: #6bdcff;
  --icon-btn-color: #a9c1d5;
  --star-color: #9b9e9f;
  --star-active: #f2ce55;
  --star-shadow: 0 0 8px #e8bf4533;

  /* Шкалы производительности */
  --track-bg: #14283b;
  --bar-c1-nv: #4f7a2a;
  --bar-c2-nv: #a6d36a;
  --bar-c1-amd: #b5434b;
  --bar-c2-amd: #f08e93;
  --bar-c1-in: #2f78ad;
  --bar-c2-in: #7cc6f2;
  --perf-text: #d5e5f3;
  --perf-sub: #7f9db8;
  --mini-perf-val: #9fc0da;

  /* Блокнот заметок */
  --draw-card-bg: linear-gradient(160deg, #10253a, #0b1929);
  --draw-card-border: #2c526f;
  --draw-head: #d8eafa;
  --draw-paper-bg: #122a40;
  --draw-paper-border: #41617d;
  --draw-paper-margin: #8e626d;
  --draw-paper-line: #31516e;
  --draw-paper-shadow: inset 0 0 24px #06101b88;
  --draw-send-bg: linear-gradient(135deg, #176b83, #16558b);
  --draw-send-border: #348ba7;
  --draw-send-color: #e8fbff;
  --draw-editor-bg: #101820;
  --draw-editor-color: #ffffff;
  --draw-editor-ph: #aebfd0;

  /* Модальные окна и прокрутка */
  --modal-bg: linear-gradient(160deg, #10243a, #091522);
  --modal-border: #315675;
  --modal-text: #a9bfd5;
  --modal-input-bg: #081727;
  --modal-input-border: #2c4a65;
  --modal-actions-bg: #0a1828;
  --rate-row-bg: linear-gradient(160deg, #0c2033, #091827);
  --rate-row-border: #234560;
  --rate-ctrl-bg: #071523;
  --rate-choice-color: #a9c4da;
  --rate-choice-active-bg: #145070;
  --rate-choice-active-color: #ffffff;
  --rate-sug-hover-bg: #12354c;
  --rate-sug-hover-color: #63e3f5;
  --scroll-thumb: #247ca2;
  --scroll-track: #091726;
  --faq-item-bg: rgba(16, 37, 59, 0.55);
}

/* 2. Сброс и базовый каркас страницы */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
}

/* 3. Верхняя панель */
.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 225px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--logo-bg);
  display: grid;
  place-items: center;
  color: var(--logo-color);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.2px;
  box-shadow: var(--logo-shadow);
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
}

.bt-sub {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 17px;
  text-transform: uppercase;
  white-space: nowrap;
}

.bt-name {
  font-size: 36px;
  line-height: 34px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
  white-space: nowrap;
}

.bt-name span {
  color: var(--cyan);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.theme-picker-label {
  font-size: 11px;
  color: var(--muted);
}

.theme-picker {
  max-width: 125px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 11px;
  cursor: pointer;
}

.burger,
.drawer-backdrop {
  display: none;
}

/* 4. Кнопки */
.btn {
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: filter 0.15s, background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  filter: brightness(1.14);
}

.btn svg {
  vertical-align: -2px;
}

.btn[aria-pressed="true"] {
  border-color: var(--btn-active-border);
  background: var(--btn-active-bg);
  color: var(--btn-active-color);
}

.btn.primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-color);
  font-weight: 700;
}

.login-btn {
  background: var(--login-bg);
  border-color: var(--login-border);
  color: #ffffff;
  font-weight: 750;
}

.icon-only {
  width: 34px;
  height: 30px;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 5. Сетка и боковое меню */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 248px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}

.sidebar,
.rightbar,
.main {
  min-height: 0;
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  border-radius: 14px;
  box-shadow: 0 12px 35px #0002;
}

.sidebar {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.sidebar #siteFeedback {
  margin-top: 0;
  text-align: left;
  width: 100%;
}

.section-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--section-label);
  font-weight: 800;
  margin: 8px 10px;
}

.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--nav-color);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.navitem:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-color);
}

.navitem.active {
  color: var(--nav-active-color);
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
}

.navitem .ico {
  width: 20px;
  text-align: center;
  color: var(--cyan);
  font-size: 16px;
}

.help-card {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--help-border);
  border-radius: 12px;
  background: var(--help-bg);
}

.help-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--help-title);
}

.help-title:before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--help-dot);
  box-shadow: var(--help-dot-shadow);
}

.help-sub {
  margin: 5px 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--help-sub);
}

.help-links {
  display: grid;
  gap: 6px;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--hc);
  border-radius: 9px;
  background: var(--hb);
  color: var(--hf);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}

.help-link:before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.help-link:hover {
  filter: brightness(1.16);
  transform: translateX(2px);
}

.help-link.max { --hc: var(--help-max-border); --hb: var(--help-max-bg); --hf: var(--help-max-fg); }
.help-link.tg  { --hc: var(--help-tg-border);  --hb: var(--help-tg-bg);  --hf: var(--help-tg-fg); }
.help-link.wa  { --hc: var(--help-wa-border);  --hb: var(--help-wa-bg);  --hf: var(--help-wa-fg); }

.burger:focus-visible,
.help-link:focus-visible,
.rate-choice:focus-visible,
.remove-rate-row:focus-visible,
.rate-game-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* 6. Основная область и строка фильтров */
.main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.count,
.filter-title {
  display: none;
}

.filters {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(4px, 0.7vw, 10px);
  padding: 7px clamp(8px, 1vw, 12px);
}

.all-filter       { --brand-color: var(--brand-all); }
.nvidia-filter    { --brand-color: var(--brand-nvidia); }
.amd-filter       { --brand-color: var(--brand-amd); }
.intel-filter     { --brand-color: var(--brand-intel); }
.retro-filter     { --brand-color: var(--brand-retro); }
.favorites-filter { --brand-color: var(--brand-fav); }

.gpu-filter {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  max-width: none;
  border-radius: 8px;
  background: var(--filter-bg);
}

.favorites-filter {
  flex-grow: 0.8;
}

.gpu-filter input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--filter-border);
  border-radius: 8px;
  background: transparent;
  color: var(--filter-text);
  caret-color: var(--filter-text);
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 750;
  text-align: left;
  text-overflow: ellipsis;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gpu-filter input::placeholder {
  color: transparent;
  opacity: 0;
}

.gpu-filter input:focus {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-color) 20%, transparent);
}

.filter-ghost {
  position: absolute;
  z-index: 1;
  left: 4px;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 800;
  color: var(--brand-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.favorites-filter .filter-ghost {
  color: var(--brand-fav-ghost);
}

.gpu-filter.has-value .filter-ghost {
  opacity: 0.18;
}

.filter-arrow {
  position: absolute;
  z-index: 3;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 16px;
  background: color-mix(in srgb, var(--brand-color) 15%, var(--filter-arrow-base));
  color: var(--brand-color);
  cursor: pointer;
}

.filter-options {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 100%;
  max-width: min(320px, 90vw);
  max-height: 240px;
  overflow: auto;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--brand-color) 45%, var(--filter-menu-border-base));
  border-radius: 10px;
  background: var(--filter-menu-bg);
  box-shadow: var(--filter-menu-shadow);
}

.gpu-filter:nth-last-child(-n+2) .filter-options {
  left: auto;
  right: 0;
}

.gpu-filter.open .filter-options {
  display: block;
}

.filter-option {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  color: var(--filter-opt-color);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.filter-option:hover,
.filter-option:focus {
  background: color-mix(in srgb, var(--brand-color) 17%, var(--filter-opt-hover-base));
  color: var(--filter-opt-hover-color);
  outline: none;
}

.filter-pending {
  opacity: 0.7;
  cursor: default;
  animation: filterPending 1.2s ease-in-out infinite alternate;
}

@keyframes filterPending {
  from { opacity: 0.45; }
  to   { opacity: 0.9; }
}

/* 7. Панель таблицы и основная таблица (#gpuTable) */
.table-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.table-panel:not(.orient-h) #gridT,
.table-panel.orient-h #gpuTable {
  display: none;
}

.table-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  overscroll-behavior-x: contain;
  cursor: ew-resize;
}

.table-viewport::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.table-viewport::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

.table-viewport::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 10px;
  border: 2px solid var(--scroll-track);
}

#gpuTable {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  width: auto;
  min-width: 100%;
  font-size: 12px;
}

#gpuTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--th-bg);
  color: var(--th-color);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  text-align: center;
  vertical-align: middle;
  padding: 5px 8px;
  line-height: 1.12;
  border-bottom: 1px solid var(--th-bottom);
  border-right: 1px solid var(--th-border);
  box-shadow: var(--th-inset);
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

#gpuTable thead th.nc {
  text-transform: none;
  letter-spacing: 0.2px;
}

#gpuTable thead th small {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
  color: var(--muted);
}

#gpuTable tbody td {
  padding: 6px 10px;
  line-height: 1.2;
  border-bottom: 1px solid var(--td-border-b);
  border-right: 1px solid var(--td-border-r);
  color: var(--td-color);
  background: var(--td-bg);
  white-space: nowrap;
}

#gpuTable tbody td:nth-child(n+3) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#gpuTable tbody tr:nth-child(even) td {
  background: var(--td-alt);
}

#gpuTable tbody tr:hover td {
  background: var(--td-hover);
}

#gpuTable th:first-child,
#gpuTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
}

#gpuTable thead th:first-child,
#gpuTable thead th.remove-column-head {
  z-index: 7;
  background: var(--th-sticky-bg);
  padding: 3px;
}

#gpuTable tbody td:first-child,
#gpuTable tbody td.remove-cell {
  background: var(--td-sticky);
  font-weight: 700;
  height: 56px;
  padding: 4px;
  text-align: center;
  vertical-align: middle;
  border-right: 1px solid var(--th-border);
}

#gpuTable thead th:nth-child(2),
#gpuTable tbody td:nth-child(2) {
  position: sticky;
  left: 34px;
  z-index: 3;
  min-width: 210px;
  background: var(--td-sticky);
}

#gpuTable thead th:nth-child(2) {
  z-index: 6;
  background: var(--th-sticky-bg);
}

#gpuTable tbody tr:nth-child(even) td:first-child,
#gpuTable tbody tr:nth-child(even) td:nth-child(2) {
  background: var(--td-sticky-alt);
}

#gpuTable tbody tr:hover td:first-child,
#gpuTable tbody tr:hover td:nth-child(2) {
  background: var(--td-sticky-hover);
}

#gpuTable thead th:last-child,
#gpuTable tbody td:last-child {
  border-right: 1px solid var(--th-border);
}

.col-tensor[hidden] {
  display: none;
}

.already-selected td {
  outline: 1px solid var(--selected-outline);
  outline-offset: -1px;
}

/* Ячейки действий, названия, брендов и CPU */
.remove-gpu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 26px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--icon-btn-color);
  font-size: 0;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.remove-gpu svg {
  width: 15px;
  height: 15px;
  display: block;
  margin: auto;
}

.remove-gpu:hover {
  color: #ff6575;
  transform: scale(1.16);
}

.remove-gpu:focus-visible {
  outline: 1px solid #ff6575;
  outline-offset: -3px;
  border-radius: 4px;
}

.favorite-star {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--star-color);
  font-size: 19px;
  line-height: 1.05;
  cursor: pointer;
  padding: 1px 0 3px;
}

.favorite-star.is-favorite {
  color: var(--star-active);
  text-shadow: var(--star-shadow);
}

.favorite-star:hover {
  transform: scale(1.12);
}

.gpu-name {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.gpu-name > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gpu-name .brand-name {
  display: block;
  font-weight: 800;
  min-height: 2.4em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.gpu-name .brand-name.nvidia,
.tg-head[data-brand="NVIDIA"] .t-name { color: var(--name-nvidia); }
.gpu-name .brand-name.amd,
.tg-head[data-brand="AMD"] .t-name    { color: var(--name-amd); }
.gpu-name .brand-name.intel,
.tg-head[data-brand="INTEL"] .t-name  { color: var(--name-intel); }

.gpu-name small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.15;
}

#gpuTable .gpu-mark {
  width: auto;
  min-width: 29px;
  height: 24px;
  padding: 0 5px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--mark-bg);
  color: var(--mark-color);
  border: 1px solid var(--mark-border);
  font-size: 9px;
  font-weight: 900;
  flex: 0 0 auto;
}

#gpuTable .gpu-mark.nvidia-mark { background: var(--mark-nv-bg);  color: var(--mark-nv-color);  border-color: var(--mark-nv-border); }
#gpuTable .gpu-mark.amd-mark    { background: var(--mark-amd-bg); color: var(--mark-amd-color); border-color: var(--mark-amd-border); }
#gpuTable .gpu-mark.intel-mark  { background: var(--mark-in-bg);  color: var(--mark-in-color);  border-color: var(--mark-in-border); }

.badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--badge-bg);
  color: var(--badge-color);
  font-size: 10px;
}

.badge.blue {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-color);
}

.muted {
  color: var(--muted);
}

#gpuTable .cpu-type-cell,
#gridT .cpu-type-cell {
  text-align: center;
  color: var(--cpu-type-color);
}

#gpuTable .cpu-type-cell svg,
#gridT .cpu-type-cell svg {
  display: block;
  margin: auto;
}

body.page-cpu #gpuTable td.cpu-name-cell.is-empty .mini-perf {
  display: none;
}

.cpu-cache-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: inherit;
  color: inherit;
  line-height: 1.2;
  gap: 1px;
}

.cpu-cache-wrap .cache-l12,
.cpu-cache-wrap .cache-l3 {
  font: inherit;
  color: inherit;
  white-space: nowrap;
}

/* Перетаскивание строк */
tbody td:nth-child(2) {
  cursor: grab;
  user-select: none;
}

.row-grip {
  flex: 0 0 auto;
  width: 9px;
  color: var(--grip-color);
  font-size: 15px;
  line-height: 1;
  letter-spacing: -3px;
  touch-action: none;
}

tbody tr:hover .row-grip {
  color: var(--grip-hover);
}

body.is-row-dragging,
body.is-row-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

tr.row-dragging td {
  background: var(--drag-bg) !important;
  box-shadow: var(--drag-shadow);
}

tr.row-dragging td:nth-child(n+3) {
  position: relative;
  z-index: 1;
}

tr.row-dragging td:nth-child(-n+2) {
  z-index: 5;
}

/* 8. Нижняя полоса управления под таблицей */
.table-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  min-height: 42px;
  white-space: nowrap;
}

.table-bottom #shown {
  display: none;
}

.table-bottom .bottom-spacer {
  flex: 1;
}

.table-bottom .bottom-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 30px;
}

.table-bottom .scroll-hint {
  font-size: 19px;
  line-height: 1;
  color: var(--cyan);
  white-space: nowrap;
}

.table-bottom .bottom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.table-bottom .bottom-actions .btn {
  padding: 6px 8px;
  font-size: 10px;
  border-radius: 7px;
}

#orientToggle {
  width: 34px;
  height: 30px;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#orientToggle svg {
  margin: 0;
  width: 18px;
  height: 18px;
  transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.3, 1);
}

#orientToggle[aria-pressed="true"] svg {
  transform: rotate(90deg);
}

#clearSearch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
}

#clearSearch:hover,
#clearDrawing:hover {
  color: #ff7a89;
  border-color: #7a3a48;
}

/* 9. Перевёрнутая таблица (#gridT — характеристики в строках) */
.tgrid {
  --tl: 132px;
  --tw: 128px;
  display: grid;
  grid-template-columns: minmax(min-content, var(--tl)) repeat(var(--n, 1), minmax(var(--tw), 1fr));
  width: max(100%, calc(var(--tl) + var(--n, 1) * var(--tw)));
  background: var(--td-bg);
  font-size: 12px;
  color: var(--td-color);
}

.tg-row {
  display: contents;
}

.tg-row > * {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--td-border-r);
  border-bottom: 1px solid var(--td-border-b);
  background: var(--td-bg);
  color: var(--td-color);
}

.tg-row.alt > * {
  background: var(--td-alt);
}

.tg-row > .tg-corner,
.tg-row > .tg-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--th-sticky-bg);
  color: var(--th-color);
  text-align: center;
}

.tg-row > .tg-corner {
  left: 0;
  z-index: 5;
}

.tg-row > .tg-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--th-bg);
  color: var(--th-color);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.25;
}

.tg-row.alt > .tg-label {
  background: var(--td-sticky-alt);
}

.tg-label.nc {
  text-transform: none;
  letter-spacing: 0.2px;
}

.tg-label small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.tg-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.tg-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 132px;
  cursor: grab;
  user-select: none;
}

.tg-row > .tg-head.col-dragging {
  background: var(--col-drag-bg);
}

.t-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: default;
}

.t-acts {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: -3px -4px 3px;
}

.t-grip {
  margin-right: auto;
  padding-left: 2px;
  color: var(--grip-color);
  font-size: 14px;
  line-height: 1;
  letter-spacing: -3px;
  cursor: grab;
  touch-action: none;
}

.t-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--icon-btn-color);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.t-btn.rm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.t-btn.rm svg {
  width: 15px;
  height: 15px;
}

.t-btn:hover,
.t-btn.rm:hover {
  color: #ff6575;
}

.t-btn.fav {
  font-size: 15px;
  color: var(--star-color);
}

.t-btn.fav:hover,
.t-btn.fav.is-favorite {
  color: var(--star-active);
}

.t-name {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 42px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tg-head small {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
}

.tg-head .mini-perf {
  margin-top: auto;
  width: 100%;
}

/* 10. Шкалы производительности (#perfPanel и .mini-perf) */
[data-brand="NVIDIA"] { --c1: var(--bar-c1-nv);  --c2: var(--bar-c2-nv); }
[data-brand="AMD"]    { --c1: var(--bar-c1-amd); --c2: var(--bar-c2-amd); }
[data-brand="INTEL"]  { --c1: var(--bar-c1-in);  --c2: var(--bar-c2-in); }

.mini-perf {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
  margin-top: 6px;
}

.mini-perf b {
  min-width: 30px;
  flex: 0 0 30px;
  text-align: right;
  font-size: 10px;
  color: var(--mini-perf-val);
  font-variant-numeric: tabular-nums;
}

.mini-track,
.perf-track {
  flex: 1;
  min-width: 0;
  height: 7px;
  border-radius: 6px;
  background: var(--track-bg);
  overflow: hidden;
}

.mini-fill,
.perf-fill {
  display: block;
  height: 100%;
  width: 0;
  min-width: 3px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--c1, var(--blue)), var(--c2, var(--cyan)));
  transition: width 0.8s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.perf-panel {
  flex: 0 0 auto;
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  padding: 0 4px 6px;
}

.perf-panel .perf-head {
  display: none;
}

.perf-list {
  position: relative;
  max-height: 126px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.perf-empty {
  font-size: 11px;
  color: var(--perf-sub);
}

.perf-empty[hidden] {
  display: none;
}

.perf-row {
  display: grid;
  grid-template-columns: 20px minmax(120px, 220px) 1fr 52px;
  align-items: center;
  gap: 10px;
  height: 25px;
  font-size: 12px;
  color: var(--perf-text);
  transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 0.35s;
}

.perf-row.entering {
  opacity: 0;
}

.perf-row.leaving {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.perf-rank {
  text-align: center;
  font-size: 11px;
  color: var(--perf-sub);
}

.perf-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 700;
}

.perf-val {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 11. Правая колонка: блокнот «Заметки» и уведомление о cookie */
.rightbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.right-card {
  padding: 15px;
}

.drawing-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 0 1 440px;
  height: 440px;
  min-height: 230px;
  padding: 12px;
  background: var(--draw-card-bg);
  border-color: var(--draw-card-border);
  color: var(--text);
  overflow: hidden;
}

.drawing-head {
  flex: 0 0 auto;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--draw-head);
  padding: 3px 2px 10px;
}

.drawing-head small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

.drawing-tools {
  display: flex;
  gap: 5px;
  padding: 0 0 7px;
  flex: 0 0 auto;
}

.drawing-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 31px;
  height: 29px;
  padding: 4px 8px;
  font-size: 14px;
}

.drawing-tool.active {
  background: var(--btn-active-bg);
  border-color: var(--btn-active-border);
  color: var(--btn-active-color);
}

.drawing-paper-wrap {
  position: relative;
  flex: 1;
  min-height: 100px;
  overflow: hidden;
  border: 1px solid var(--draw-paper-border);
  border-radius: 8px;
  background-color: var(--draw-paper-bg);
  background-image:
    linear-gradient(to right, transparent 0, transparent 23px, var(--draw-paper-margin) 24px, var(--draw-paper-margin) 25px, transparent 26px),
    repeating-linear-gradient(to bottom, var(--draw-paper-bg) 0, var(--draw-paper-bg) 23px, var(--draw-paper-line) 24px, var(--draw-paper-line) 25px);
  box-shadow: var(--draw-paper-shadow);
}

.drawing-card #drawingCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 21l4.5-1L21 6.5 17.5 3 4 16.5 3 21z' fill='%23f4c542' stroke='%232b3440' stroke-width='1.1' stroke-linejoin='round'/%3E%3Cpath d='M14.5 6l3.5 3.5' stroke='%232b3440' stroke-width='1.1'/%3E%3C/svg%3E") 2 20, crosshair;
}

.drawing-card.text-mode #drawingCanvas {
  cursor: text;
}

.drawing-text-editor {
  position: absolute;
  z-index: 5;
  min-width: 90px;
  max-width: calc(100% - 12px);
  min-height: 28px;
  padding: 2px 4px;
  border: 1px dashed var(--cyan);
  border-radius: 3px;
  background: var(--draw-editor-bg);
  color: var(--draw-editor-color);
  caret-color: var(--draw-editor-color);
  font: 16px/1.35 Segoe UI, Arial, sans-serif;
  outline: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 22%, transparent);
}

.drawing-text-editor:empty:before {
  content: "Введите текст…";
  color: var(--draw-editor-ph);
  pointer-events: none;
}

.drawing-footer {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
  padding: 9px 0 0;
}

.drawing-footer .btn {
  flex: 1;
  padding: 8px 5px;
  font-size: 11px;
}

.drawing-footer .send-drawing {
  background: var(--draw-send-bg);
  border-color: var(--draw-send-border);
  color: var(--draw-send-color);
}

.drawing-share-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.drawing-share-actions .btn {
  flex: 1;
  min-width: 140px;
}

.cookie-bar {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-bg);
  color: var(--text);
  box-shadow: 0 12px 35px #0002;
  font-size: 11.5px;
  line-height: 1.45;
  flex: 0 0 auto;
}

.cookie-bar.show {
  display: flex;
}

.cookie-bar p {
  margin: 0;
  color: var(--muted);
}

.cookie-actions {
  display: flex;
  gap: 7px;
}

.cookie-actions .btn {
  flex: 1;
  padding: 8px 6px;
  font-size: 11px;
  text-align: center;
}

/* 12. Модальные окна, форма «Моя видеокарта» и страница FAQ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #020812b8;
  backdrop-filter: blur(5px);
}

.modal-backdrop.open {
  display: flex;
}

.site-modal {
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--modal-border);
  border-radius: 16px;
  background: var(--modal-bg);
  color: var(--text);
  box-shadow: 0 25px 80px #0009;
}

.site-modal h2 {
  font-size: 19px;
  margin: 0 0 10px;
}

.site-modal p {
  font-size: 13px;
  color: var(--modal-text);
  line-height: 1.6;
}

.site-modal input,
.site-modal textarea {
  width: 100%;
  margin: 6px 0;
  padding: 11px;
  border: 1px solid var(--modal-input-border);
  border-radius: 8px;
  background: var(--modal-input-bg);
  color: var(--text);
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.site-modal.rate-modal {
  position: relative;
  width: min(960px, 100%);
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.site-modal.rate-modal h2 {
  margin: 0;
  padding: 20px 56px 4px 24px;
  font-size: 20px;
}

.site-modal.rate-modal h2:before {
  content: '◈';
  margin-right: 10px;
  color: var(--cyan);
}

.site-modal.rate-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  float: none;
}

.site-modal.rate-modal #modalBody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 24px 14px;
  overscroll-behavior: contain;
}

.site-modal.rate-modal .modal-actions {
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--modal-actions-bg);
}

.rate-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.rate-hint {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.rate-row {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--rate-row-border);
  border-radius: 14px;
  background: var(--rate-row-bg);
}

.rate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr) 120px;
  gap: 12px;
}

.rate-field,
.rate-seg-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.rate-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.rate-row input {
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--modal-input-border);
  border-radius: 10px;
  background: var(--rate-ctrl-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rate-row input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 20%, transparent);
}

.rate-game-wrap {
  position: relative;
}

.rate-game-wrap .rate-game {
  padding-right: 42px;
}

.rate-game-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.rate-game-toggle:hover,
.rate-game-toggle[aria-expanded="true"] {
  color: var(--cyan);
  background: var(--btn-active-bg);
}

.rate-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--modal-border);
  border-radius: 10px;
  background: var(--rate-ctrl-bg);
  box-shadow: 0 14px 30px #000a;
}

.rate-suggestions[hidden] {
  display: none;
}

.rate-suggestion {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.rate-suggestion:last-child {
  border-bottom: 0;
}

.rate-suggestion:hover,
.rate-suggestion:focus {
  background: var(--rate-sug-hover-bg);
  color: var(--rate-sug-hover-color);
  outline: none;
}

.rate-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 28px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--rate-row-border);
}

.rate-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--modal-input-border);
  border-radius: 10px;
  background: var(--rate-ctrl-bg);
}

.rate-choice {
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--rate-choice-color);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.rate-choice:hover {
  color: var(--text);
}

.rate-choice.active {
  background: var(--rate-choice-active-bg);
  color: var(--rate-choice-active-color);
}

.remove-rate-row {
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid #553644;
  border-radius: 9px;
  background: #2a1723;
  color: #ff9aa8;
  font-size: 12px;
  cursor: pointer;
}

.remove-rate-row:hover {
  background: #48202e;
  border-color: #ff8195;
}

.rate-row:only-child .remove-rate-row {
  display: none;
}

.faq-page {
  max-width: 100%;
  line-height: 1.65;
  color: var(--text);
}

.faq-page .faq-intro {
  font-size: 1.02em;
  color: var(--muted);
  margin: 0 0 18px;
}

.faq-page h2 {
  font-size: 1.08em;
  margin: 22px 0 6px;
  color: var(--accent);
}

.faq-page p {
  margin: 0 0 10px;
}

.faq-item {
  background: var(--faq-item-bg);
}

.site-modal.faq-reading {
  width: min(900px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.site-modal.faq-reading h2 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0 40px 18px 0;
}

/* 13. Темы оформления (единые чистые переопределения переменных) */

/* 13.1 Чёрно-белая тема */
body.theme-mono {
  --bg: #0e0e0e;
  --bg-page: #0e0e0e;
  --topbar-bg: #121212;
  --panel: #171717;
  --panel2: #222222;
  --panel-bg: #171717;
  --line: #3a3a3a;
  --text: #f2f2f2;
  --muted: #a6a6a6;
  --cyan: #ffffff;
  --blue: #888888;
  --green: #dcdcdc;
  --yellow: #eaeaea;
  --accent: #ffffff;

  --logo-bg: linear-gradient(135deg, #f0f0f0, #9a9a9a);
  --logo-color: #111111;
  --logo-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
  --burger-bg: #222222;
  --burger-line: #e5e5e5;
  --section-label: #8c8c8c;
  --nav-color: #b5b5b5;
  --nav-hover-bg: #242424;
  --nav-hover-color: #ffffff;
  --nav-active-bg: linear-gradient(90deg, #2e2e2e, #222222);
  --nav-active-border: #5a5a5a;
  --nav-active-color: #ffffff;

  --help-bg: #1e1e1e;
  --help-border: #3f3f3f;
  --help-title: #f2f2f2;
  --help-dot: #dcdcdc;
  --help-dot-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  --help-sub: #a0a0a0;
  --help-max-border: #4a4a4a;
  --help-max-bg: #262626;
  --help-max-fg: #ededed;
  --help-tg-border: #4a4a4a;
  --help-tg-bg: #262626;
  --help-tg-fg: #ededed;
  --help-wa-border: #4a4a4a;
  --help-wa-bg: #262626;
  --help-wa-fg: #ededed;

  --btn-bg: #262626;
  --btn-border: #4d4d4d;
  --btn-color: #f2f2f2;
  --btn-active-bg: #383838;
  --btn-active-border: #9a9a9a;
  --btn-active-color: #ffffff;
  --btn-primary-bg: linear-gradient(135deg, #424242, #2b2b2b);
  --btn-primary-border: #777777;
  --login-bg: linear-gradient(135deg, #424242, #2b2b2b);
  --login-border: #777777;

  --filter-bg: #141414;
  --filter-border: #3f3f3f;
  --filter-text: #f5f5f5;
  --filter-arrow-base: #252525;
  --filter-menu-bg: #161616;
  --filter-menu-border-base: #4a4a4a;
  --filter-opt-color: #e5e5e5;
  --filter-opt-hover-base: #2c2c2c;
  --brand-all: #dcdcdc;
  --brand-nvidia: #dcdcdc;
  --brand-amd: #dcdcdc;
  --brand-intel: #dcdcdc;
  --brand-retro: #dcdcdc;
  --brand-fav: #dcdcdc;
  --brand-fav-ghost: #dcdcdc;

  --th-bg: #262626;
  --th-sticky-bg: #262626;
  --th-color: #e5e5e5;
  --th-border: #3f3f3f;
  --th-bottom: #4a4a4a;
  --th-inset: none;
  --td-bg: #161616;
  --td-alt: #1b1b1b;
  --td-hover: #2a2a2a;
  --td-sticky: #1c1c1c;
  --td-sticky-alt: #202020;
  --td-sticky-hover: #2a2a2a;
  --td-color: #ededed;
  --td-border-r: #2e2e2e;
  --td-border-b: #2e2e2e;
  --drag-bg: #333333;
  --drag-shadow: 0 -1px 0 #bbbbbb, 0 1px 0 #bbbbbb, 0 12px 16px -10px #000;
  --col-drag-bg: #333333;
  --grip-color: #7a7a7a;
  --grip-hover: #e5e5e5;
  --cpu-type-color: #d8d8d8;
  --selected-outline: #cfcfcf;

  --name-nvidia: #f0f0f0;
  --name-amd: #f0f0f0;
  --name-intel: #f0f0f0;
  --mark-bg: #2a2a2a;
  --mark-color: #f0f0f0;
  --mark-border: #4d4d4d;
  --mark-nv-bg: #2a2a2a;
  --mark-nv-color: #f0f0f0;
  --mark-nv-border: #4d4d4d;
  --mark-amd-bg: #2a2a2a;
  --mark-amd-color: #f0f0f0;
  --mark-amd-border: #4d4d4d;
  --mark-in-bg: #2a2a2a;
  --mark-in-color: #f0f0f0;
  --mark-in-border: #4d4d4d;
  --badge-bg: #292929;
  --badge-color: #e5e5e5;
  --badge-blue-bg: #292929;
  --badge-blue-color: #e5e5e5;

  --track-bg: #2a2a2a;
  --bar-c1-nv: #757575;
  --bar-c2-nv: #ececec;
  --bar-c1-amd: #757575;
  --bar-c2-amd: #ececec;
  --bar-c1-in: #757575;
  --bar-c2-in: #ececec;
  --perf-text: #ececec;
  --perf-sub: #a8a8a8;
  --mini-perf-val: #a8a8a8;

  --draw-card-bg: #181818;
  --draw-card-border: #3a3a3a;
  --draw-head: #f2f2f2;
  --draw-paper-bg: #1f1f1f;
  --draw-paper-border: #484848;
  --draw-paper-margin: #595959;
  --draw-paper-line: #333333;
  --draw-send-bg: linear-gradient(135deg, #3c3c3c, #272727);
  --draw-send-border: #686868;
  --draw-send-color: #ffffff;
  --draw-editor-bg: #151515;
  --draw-editor-color: #ffffff;

  --modal-bg: #181818;
  --modal-border: #444444;
  --modal-text: #b0b0b0;
  --modal-input-bg: #111111;
  --modal-input-border: #444444;
  --modal-actions-bg: #141414;
  --rate-row-bg: #1d1d1d;
  --rate-row-border: #3d3d3d;
  --rate-ctrl-bg: #121212;
  --rate-choice-color: #b5b5b5;
  --rate-choice-active-bg: #3c3c3c;
  --rate-sug-hover-bg: #2c2c2c;
  --rate-sug-hover-color: #ffffff;
  --scroll-thumb: #555555;
  --scroll-track: #141414;
  --faq-item-bg: rgba(34, 34, 34, 0.7);
}

/* 13.2 Светлая тема */
body.theme-light,
body[data-theme="light"] {
  --bg: #dce4ee;
  --bg-page: #dce4ee;
  --topbar-bg: #eef3f9;
  --panel: #f4f7fb;
  --panel2: #e4ebf3;
  --panel-bg: #f4f7fb;
  --line: #aebecd;
  --text: #101c2b;
  --muted: #3e5266;
  --cyan: #06698c;
  --blue: #1a5f96;
  --green: #126b4d;
  --yellow: #a37000;
  --accent: #06698c;

  --burger-bg: #e3ebf4;
  --burger-line: #101c2b;
  --section-label: #4a6075;
  --nav-color: #24374b;
  --nav-hover-bg: #e2ebf4;
  --nav-hover-color: #0c1826;
  --nav-active-bg: linear-gradient(90deg, #cfe1f2, #dce9f6);
  --nav-active-border: #7ea3c4;
  --nav-active-color: #091826;

  --help-bg: linear-gradient(160deg, #e3ecf5, #d8e3ef);
  --help-border: #9cb2c7;
  --help-title: #101c2b;
  --help-sub: #394d61;
  --help-max-border: #8c78b8;
  --help-max-bg: #ece7f8;
  --help-max-fg: #3a2666;
  --help-tg-border: #6ba3c9;
  --help-tg-bg: #e1eff9;
  --help-tg-fg: #0f456b;
  --help-wa-border: #68a895;
  --help-wa-bg: #e0f3ec;
  --help-wa-fg: #0f4f3c;

  --btn-bg: #e3ebf4;
  --btn-border: #9fb1c4;
  --btn-color: #101c2b;
  --btn-active-bg: #087296;
  --btn-active-border: #065a78;
  --btn-active-color: #ffffff;
  --btn-primary-bg: linear-gradient(135deg, #0d82ab, #145fa3);
  --btn-primary-border: #0a6b8f;
  --login-bg: linear-gradient(135deg, #0d82ab, #145fa3);
  --login-border: #0a6b8f;

  --filter-bg: #ffffff;
  --filter-border: #8ea3b8;
  --filter-text: #0d1826;
  --filter-arrow-base: #e6edf5;
  --filter-menu-bg: #ffffff;
  --filter-menu-border-base: #8ea3b8;
  --filter-menu-shadow: 0 12px 28px rgba(16, 28, 43, 0.18);
  --filter-opt-color: #101c2b;
  --filter-opt-hover-base: #e7eef6;
  --filter-opt-hover-color: #08121d;
  --brand-all: #056385;
  --brand-nvidia: #3f6b12;
  --brand-amd: #a6262e;
  --brand-intel: #165a8f;
  --brand-retro: #785920;
  --brand-fav: #87610e;
  --brand-fav-ghost: #87610e;

  --th-bg: #dce5f0;
  --th-sticky-bg: #dce5f0;
  --th-color: #152638;
  --th-border: #aebecd;
  --th-bottom: #9cb0c2;
  --th-inset: none;
  --td-bg: #f8fafd;
  --td-alt: #edf2f8;
  --td-hover: #d9e6f3;
  --td-sticky: #eef3f9;
  --td-sticky-alt: #e3ebf4;
  --td-sticky-hover: #d9e6f3;
  --td-color: #101c2b;
  --td-border-r: #c5d1de;
  --td-border-b: #c5d1de;
  --drag-bg: #cfe0f2;
  --drag-shadow: 0 -1px 0 #06698c, 0 1px 0 #06698c, 0 10px 16px -8px rgba(16, 28, 43, 0.25);
  --col-drag-bg: #cfe0f2;
  --grip-color: #6b8196;
  --grip-hover: #06698c;
  --cpu-type-color: #2b4c6b;

  --name-nvidia: #3a660f;
  --name-amd: #a6242c;
  --name-intel: #14568a;
  --mark-bg: #dce7f2;
  --mark-color: #06698c;
  --mark-border: #9cb4ca;
  --mark-nv-bg: #e1efd6;
  --mark-nv-color: #345c0c;
  --mark-nv-border: #9ec282;
  --mark-amd-bg: #f6dfe1;
  --mark-amd-color: #9c1f27;
  --mark-amd-border: #d6989d;
  --mark-in-bg: #dcebf7;
  --mark-in-color: #124f80;
  --mark-in-border: #8eb8db;
  --badge-bg: #d8efe6;
  --badge-color: #0f5c41;
  --badge-blue-bg: #d8eaf7;
  --badge-blue-color: #0d4e7d;
  --icon-btn-color: #465b70;
  --star-color: #7a8b9c;
  --star-active: #c98a00;
  --star-shadow: none;

  --track-bg: #cbd6e3;
  --bar-c1-nv: #3b6b10;
  --bar-c2-nv: #6ca32d;
  --bar-c1-amd: #9e222a;
  --bar-c2-amd: #d6545c;
  --bar-c1-in: #135487;
  --bar-c2-in: #3888c4;
  --perf-text: #0f1c2b;
  --perf-sub: #3c5064;
  --mini-perf-val: #132436;

  --draw-card-bg: #f4f7fb;
  --draw-card-border: #aebecd;
  --draw-head: #101c2b;
  --draw-paper-bg: #ffffff;
  --draw-paper-border: #9fb1c4;
  --draw-paper-margin: #dfa1ad;
  --draw-paper-line: #cfdbe8;
  --draw-paper-shadow: inset 0 0 14px rgba(16, 28, 43, 0.08);
  --draw-send-bg: linear-gradient(135deg, #0d82ab, #145fa3);
  --draw-send-border: #0a6b8f;
  --draw-send-color: #ffffff;
  --draw-editor-bg: #ffffff;
  --draw-editor-color: #101c2b;
  --draw-editor-ph: #6d7c8b;

  --modal-bg: #f4f7fb;
  --modal-border: #9fb1c4;
  --modal-text: #394d61;
  --modal-input-bg: #ffffff;
  --modal-input-border: #8ea3b8;
  --modal-actions-bg: #e8eff6;
  --rate-row-bg: #edf2f8;
  --rate-row-border: #aebecd;
  --rate-ctrl-bg: #ffffff;
  --rate-choice-color: #24374b;
  --rate-choice-active-bg: #087296;
  --rate-sug-hover-bg: #dce8f4;
  --rate-sug-hover-color: #065a78;
  --scroll-thumb: #7c95ad;
  --scroll-track: #dce4ee;
  --faq-item-bg: #edf2f8;
}

body.theme-light .btn:hover {
  background: #d5e1ee;
  filter: none;
}

body.theme-light .navitem {
  font-weight: 500;
}

body.theme-light .navitem.active {
  font-weight: 700;
}

body.theme-light .perf-panel {
  background: #e7eef6;
  border: 1px solid #aebecd;
  border-radius: 12px;
  padding: 8px 12px;
}

body.theme-light .perf-name,
body.theme-light .perf-val,
body.theme-light .mini-perf b {
  font-weight: 800;
}

/* 13.3 Фиолетовая тема */
body.theme-purple,
body.theme-violet,
body[data-theme="purple"],
body[data-theme="violet"] {
  --bg: #0d0917;
  --bg-page: radial-gradient(ellipse at 50% 0%, #241545 0%, #0d0917 60%);
  --topbar-bg: #110b1f;
  --panel: #150f24;
  --panel2: #1d1533;
  --panel-bg: linear-gradient(180deg, #171029f5, #120c21f5);
  --line: #382859;
  --text: #f3eeff;
  --muted: #a89ac7;
  --cyan: #b98aff;
  --blue: #7c4dff;
  --green: #5ce1b8;
  --yellow: #ffd27d;
  --accent: #b98aff;

  --logo-bg: linear-gradient(135deg, #c79eff, #7b42f6);
  --logo-color: #100721;
  --logo-shadow: 0 0 22px rgba(185, 138, 255, 0.28);
  --burger-bg: #1e1536;
  --burger-line: #efe8ff;
  --section-label: #9684bd;
  --nav-color: #bfb2db;
  --nav-hover-bg: #22183b;
  --nav-hover-color: #ffffff;
  --nav-active-bg: linear-gradient(90deg, #322059, #241742);
  --nav-active-border: #5b3e99;
  --nav-active-color: #ffffff;

  --help-bg: linear-gradient(160deg, #21163b, #18102b);
  --help-border: #473373;
  --help-title: #f5f0ff;
  --help-dot: #c79eff;
  --help-dot-shadow: 0 0 8px rgba(199, 158, 255, 0.5);
  --help-sub: #b2a3d1;
  --help-max-border: #6d4cb3;
  --help-max-bg: #2a1d47;
  --help-max-fg: #efe5ff;
  --help-tg-border: #53499e;
  --help-tg-bg: #201c42;
  --help-tg-fg: #e3e6ff;
  --help-wa-border: #3d6e66;
  --help-wa-bg: #192e2b;
  --help-wa-fg: #dcf7f0;

  --btn-bg: #21163b;
  --btn-border: #4b3678;
  --btn-color: #efe8ff;
  --btn-active-bg: #53329c;
  --btn-active-border: #9e75ff;
  --btn-primary-bg: linear-gradient(135deg, #8b5cf6, #5b21b6);
  --btn-primary-border: #b98aff;
  --login-bg: linear-gradient(135deg, #8b5cf6, #5b21b6);
  --login-border: #b98aff;

  --filter-bg: #130d24;
  --filter-border: #43306b;
  --filter-text: #f6f2ff;
  --filter-arrow-base: #1b1230;
  --filter-menu-bg: #130c24;
  --filter-menu-border-base: #4a3575;
  --filter-opt-color: #ebe3ff;
  --filter-opt-hover-base: #261942;

  --th-bg: #22173d;
  --th-sticky-bg: #22173d;
  --th-color: #e7dcff;
  --th-border: #412f69;
  --th-bottom: #4e397d;
  --th-inset: none;
  --td-bg: #140e24;
  --td-alt: #19122b;
  --td-hover: #281c45;
  --td-sticky: #19112b;
  --td-sticky-alt: #1e1533;
  --td-sticky-hover: #281c45;
  --td-color: #f3eeff;
  --td-border-r: #2c2047;
  --td-border-b: #2c2047;
  --drag-bg: #322159;
  --col-drag-bg: #322159;
  --cpu-type-color: #c5b3eb;
  --mark-bg: #261a42;
  --mark-color: #d6baff;
  --mark-border: #543b8c;

  --track-bg: #271b42;
  --perf-text: #f3eeff;
  --perf-sub: #a89ac7;
  --mini-perf-val: #cbbbe8;

  --draw-card-bg: #160f26;
  --draw-card-border: #382859;
  --draw-head: #f3eeff;
  --draw-paper-bg: #1b132e;
  --draw-paper-border: #4b3678;
  --draw-paper-margin: #7d4975;
  --draw-paper-line: #312352;
  --draw-send-bg: linear-gradient(135deg, #7c4dff, #4c2899);
  --draw-send-border: #9e75ff;

  --modal-bg: #171029;
  --modal-border: #4b3678;
  --modal-text: #bfb2db;
  --modal-input-bg: #110b1f;
  --modal-input-border: #46326e;
  --modal-actions-bg: #1c1430;
  --rate-row-bg: #1c1430;
  --rate-row-border: #3d2c63;
  --rate-ctrl-bg: #110b1f;
  --rate-choice-active-bg: #673ab7;
  --rate-sug-hover-bg: #2a1c4a;
  --rate-sug-hover-color: #d6baff;
  --scroll-thumb: #6b4cb0;
  --scroll-track: #120c21;
  --faq-item-bg: rgba(34, 23, 61, 0.6);
}

/* 13.4 Зелёная тема */
body.theme-forest,
body.theme-green,
body.theme-emerald,
body[data-theme="forest"],
body[data-theme="green"] {
  --bg: #07120e;
  --bg-page: radial-gradient(ellipse at 50% 0%, #103326 0%, #07120e 60%);
  --topbar-bg: #091712;
  --panel: #0d1d17;
  --panel2: #132920;
  --panel-bg: linear-gradient(180deg, #0f211af5, #0b1914f5);
  --line: #234739;
  --text: #eafaf3;
  --muted: #93b8a8;
  --cyan: #3ee6a8;
  --blue: #169c6b;
  --green: #4de0ad;
  --yellow: #ffd27d;
  --accent: #3ee6a8;

  --logo-bg: linear-gradient(135deg, #47ebb0, #129463);
  --logo-color: #04140e;
  --logo-shadow: 0 0 22px rgba(62, 230, 168, 0.25);
  --burger-bg: #122920;
  --burger-line: #e3f7ee;
  --section-label: #79a693;
  --nav-color: #add1c2;
  --nav-hover-bg: #153026;
  --nav-hover-color: #ffffff;
  --nav-active-bg: linear-gradient(90deg, #194534, #133327);
  --nav-active-border: #2f755a;
  --nav-active-color: #ffffff;

  --help-bg: linear-gradient(160deg, #132b22, #0d1f18);
  --help-border: #2a5746;
  --help-title: #eefcf6;
  --help-dot: #47ebb0;
  --help-dot-shadow: 0 0 8px rgba(71, 235, 176, 0.5);
  --help-sub: #9bc2b2;
  --help-max-border: #514a87;
  --help-max-bg: #1c1a33;
  --help-max-fg: #e6e3ff;
  --help-tg-border: #2c6b63;
  --help-tg-bg: #122e2a;
  --help-tg-fg: #dcf7f3;
  --help-wa-border: #317859;
  --help-wa-bg: #143627;
  --help-wa-fg: #dffcf0;

  --btn-bg: #132b22;
  --btn-border: #2c5c49;
  --btn-color: #e3f7ee;
  --btn-active-bg: #1c6b4d;
  --btn-active-border: #47ebb0;
  --btn-primary-bg: linear-gradient(135deg, #10b981, #047857);
  --btn-primary-border: #47ebb0;
  --login-bg: linear-gradient(135deg, #10b981, #047857);
  --login-border: #47ebb0;

  --filter-bg: #0a1712;
  --filter-border: #295443;
  --filter-text: #f0fcf7;
  --filter-arrow-base: #10241c;
  --filter-menu-bg: #0a1712;
  --filter-menu-border-base: #2f614d;
  --filter-opt-color: #e1f5ec;
  --filter-opt-hover-base: #163327;

  --th-bg: #142e24;
  --th-sticky-bg: #142e24;
  --th-color: #dcf5ea;
  --th-border: #285242;
  --th-bottom: #336954;
  --th-inset: none;
  --td-bg: #0c1c16;
  --td-alt: #10241c;
  --td-hover: #1a3b2e;
  --td-sticky: #10241c;
  --td-sticky-alt: #142b22;
  --td-sticky-hover: #1a3b2e;
  --td-color: #eafaf3;
  --td-border-r: #1b382d;
  --td-border-b: #1b382d;
  --drag-bg: #1c4736;
  --col-drag-bg: #1c4736;
  --cpu-type-color: #8fd4b8;
  --mark-bg: #16362a;
  --mark-color: #7af2c4;
  --mark-border: #2f6e56;

  --track-bg: #173328;
  --perf-text: #eafaf3;
  --perf-sub: #93b8a8;
  --mini-perf-val: #add1c2;

  --draw-card-bg: #0e2019;
  --draw-card-border: #234739;
  --draw-head: #eafaf3;
  --draw-paper-bg: #11261e;
  --draw-paper-border: #2c5c49;
  --draw-paper-margin: #3b7a62;
  --draw-paper-line: #1e4033;
  --draw-send-bg: linear-gradient(135deg, #159969, #0d6646);
  --draw-send-border: #47ebb0;

  --modal-bg: #0f211a;
  --modal-border: #2c5c49;
  --modal-text: #add1c2;
  --modal-input-bg: #091712;
  --modal-input-border: #295443;
  --modal-actions-bg: #122920;
  --rate-row-bg: #122920;
  --rate-row-border: #254d3e;
  --rate-ctrl-bg: #091712;
  --rate-choice-active-bg: #158058;
  --rate-sug-hover-bg: #173d2e;
  --rate-sug-hover-color: #7af2c4;
  --scroll-thumb: #2f755a;
  --scroll-track: #0b1914;
  --faq-item-bg: rgba(20, 46, 36, 0.6);
}

/* 14. Адаптивность (ПК, планшеты, смартфоны) */
@media (max-height: 760px) {
  .navitem { padding: 8px 12px; }
  .sidebar { gap: 6px; }
}

@media (min-width: 761px) {
  #gpuTable tbody td:nth-child(2) {
    min-width: 165px;
    width: 165px;
    padding: 7px 8px;
  }
  #gpuTable tbody td:nth-child(2) .gpu-name {
    gap: 6px;
    align-items: center;
  }
  #gpuTable .gpu-mark {
    min-width: 23px;
    height: 23px;
    border-radius: 5px;
    font-size: 8.5px;
  }
  #gpuTable .gpu-name .brand-name {
    min-height: 0;
    line-height: 1.15;
    font-size: 11px;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  #gpuTable .gpu-name small {
    display: block;
    font-size: 9px;
    line-height: 1.1;
    margin-top: 2px;
    white-space: nowrap;
  }
}

@media (max-width: 1150px) {
  html {
    overflow-x: hidden;
    overflow-y: auto;
  }
  html,
  body {
    height: auto;
    min-height: 100%;
  }
  body {
    overflow: visible;
  }
  html.menu-open {
    overflow: hidden;
  }
  .app {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: 58px;
    gap: 10px;
    padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .burger {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--burger-bg);
    cursor: pointer;
  }
  .burger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--burger-line);
  }
  .brand {
    min-width: 0;
  }
  .theme-picker-label {
    display: none;
  }
  .theme-picker {
    max-width: 100px;
    padding: 6px 4px;
    font-size: 10px;
  }
  .layout {
    display: block;
    overflow: visible;
    padding: 10px max(10px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .main {
    overflow: visible;
  }
  .sidebar {
    display: flex;
    position: fixed;
    z-index: 300;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 86vw);
    padding: calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 0 16px 16px 0;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s 0.25s;
  }
  html.menu-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }
  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: #020812b0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  html.menu-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .navitem {
    padding: 13px 12px;
    font-size: 14px;
  }
  .table-panel {
    flex: none;
  }
  .table-viewport {
    max-height: 70vh;
    max-height: 70dvh;
  }
  .rightbar {
    display: block;
    margin-top: 10px;
    overflow: visible;
  }
  .drawing-card {
    flex: none;
    height: 360px;
    min-height: 0;
  }
  .cookie-bar {
    margin-top: 10px;
  }
  .scroll-hint {
    display: none;
  }
}

@media (max-width: 760px) {
  .login-more,
  .hide-sm {
    display: none;
  }
  .topbar {
    height: 48px;
    gap: 8px;
  }
  .logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 10.5px;
    letter-spacing: -0.1px;
  }
  .brand .brand-text {
    display: flex;
    gap: 7px;
    height: 28px;
  }
  .bt-sub {
    font-size: 8.5px;
    line-height: 14px;
    letter-spacing: 1px;
  }
  .bt-name {
    font-size: 29px;
    line-height: 28px;
  }
  .burger {
    width: 34px;
    height: 34px;
    padding: 0 8px;
    gap: 3px;
  }
  .top-actions {
    gap: 5px;
  }
  .theme-picker {
    max-width: 92px;
    font-size: 10px;
  }
  .login-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .layout {
    padding: 6px max(6px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }
  .main {
    gap: 6px;
  }
  .navitem {
    padding: 10px 12px;
    font-size: 13px;
  }
  .filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
  }
  .gpu-filter input {
    height: 32px;
    min-height: 32px;
    font-size: 12px;
    padding: 0 26px 0 8px;
  }
  .filter-ghost {
    right: 26px;
    font-size: 12px;
  }
  .filter-arrow {
    width: 22px;
    height: 22px;
    right: 3px;
    font-size: 14px;
  }
  .filter-options {
    max-height: min(260px, 45vh);
  }
  .gpu-filter:nth-child(3) .filter-options,
  .gpu-filter:nth-child(6) .filter-options {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .gpu-filter:nth-child(4) .filter-options,
  .gpu-filter:nth-child(7) .filter-options {
    left: auto;
    right: 0;
    transform: none;
  }
  #gpuTable {
    font-size: 10.5px;
  }
  #gpuTable thead th {
    font-size: 8.5px;
    padding: 4px 5px;
  }
  #gpuTable tbody td {
    padding: 4px 6px;
  }
  #gpuTable thead th:first-child,
  #gpuTable tbody td:first-child {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
  }
  #gpuTable thead th:nth-child(2),
  #gpuTable tbody td:nth-child(2) {
    left: 28px;
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    white-space: normal;
  }
  #gpuTable .gpu-mark,
  #gpuTable .gpu-name small {
    display: none;
  }
  #gpuTable .gpu-name {
    gap: 4px;
    font-size: 11px;
  }
  #gpuTable .gpu-name .brand-name {
    min-height: 2.5em;
    font-size: 10.5px;
  }
  #gpuTable .mini-perf {
    margin-top: 4px;
    gap: 4px;
  }
  #gpuTable tbody td.remove-cell {
    height: 44px;
    padding: 3px;
  }
  .remove-cell .remove-gpu {
    height: 20px;
    min-height: 20px;
  }
  .favorite-star {
    font-size: 15px;
  }
  .mini-perf b {
    min-width: 26px;
    flex-basis: 26px;
    font-size: 9px;
  }
  .mini-track,
  .perf-track {
    height: 5px;
  }
  .table-bottom {
    flex-wrap: wrap;
    white-space: normal;
    gap: 6px;
    padding: 5px 6px;
    min-height: 0;
  }
  .table-bottom .bottom-position {
    width: 100%;
  }
  .table-bottom .bottom-spacer {
    display: none;
  }
  .table-bottom .bottom-actions {
    width: 100%;
    flex-wrap: nowrap;
  }
  .table-bottom .bottom-actions .btn {
    flex: 1 1 auto;
    padding: 6px 8px;
    font-size: 10px;
  }
  .table-bottom .bottom-actions #clearSearch {
    flex: 0 0 auto;
  }
  .tgrid {
    --tl: 78px;
    --tw: 100px;
    font-size: 10.5px;
  }
  .tg-row > * {
    padding: 6px;
  }
  .tg-row > .tg-label {
    font-size: 8.5px;
  }
  .tg-head small {
    display: none;
  }
  .t-name {
    font-size: 11px;
    min-height: 2.5em;
  }
  .t-btn {
    width: 22px;
    height: 22px;
  }
  .tg-head .mini-perf {
    margin-top: auto;
    gap: 4px;
  }
  .perf-panel {
    padding: 0 2px 5px;
  }
  body.theme-light .perf-panel {
    padding: 6px 8px;
  }
  .perf-list {
    max-height: 150px;
  }
  .perf-row {
    grid-template-columns: 18px minmax(0, 1fr) 44px;
    grid-template-areas: "r n v" ". t t";
    height: auto;
    row-gap: 3px;
    padding: 3px 0;
    font-size: 11px;
  }
  .perf-rank  { grid-area: r; }
  .perf-name  { grid-area: n; }
  .perf-val   { grid-area: v; }
  .perf-track { grid-area: t; }
  .drawing-card {
    height: 300px;
    padding: 10px;
  }
  .drawing-tools {
    gap: 4px;
  }
  .drawing-tool {
    height: 32px;
    min-width: 36px;
  }
  .drawing-tool.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
    font-weight: 900;
  }
}

@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .site-modal,
  .site-modal.rate-modal,
  .site-modal.faq-reading {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }
  .site-modal {
    overflow: auto;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .site-modal.faq-reading {
    padding: 24px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .site-modal.faq-reading h2 {
    font-size: 20px;
  }
  .site-modal input,
  .site-modal textarea,
  .rate-row input {
    font-size: 14px;
  }
  .site-modal.rate-modal h2 {
    padding: 18px 52px 2px 16px;
    font-size: 18px;
  }
  .site-modal.rate-modal #modalBody {
    padding: 4px 14px 10px;
  }
  .site-modal.rate-modal .modal-actions {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .rate-grid {
    grid-template-columns: 1fr;
  }
  .rate-seg-wrap {
    width: 100%;
  }
  .rate-seg {
    display: flex;
  }
  .rate-choice {
    flex: 1;
    padding: 10px 6px;
  }
  .remove-rate-row {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .theme-picker { max-width: 82px; }
  .login-btn { font-size: 10px; padding: 5px 7px; }
  .drawing-footer { gap: 5px; }
  .drawing-footer .btn { padding: 8px 3px; font-size: 10px; }
}

@media (max-width: 359px) {
  html:not(.off-brandname) .bt-sub {
    display: none;
  }
}

@supports (-webkit-touch-callout: none) {
  .site-modal input,
  .site-modal textarea,
  .rate-row input {
    font-size: 16px;
  }
  @media (max-width: 760px) {
    .gpu-filter input {
      font-size: 16px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .mini-fill,
  .perf-fill,
  .perf-row,
  .sidebar,
  .drawer-backdrop,
  #orientToggle svg {
    transition: none !important;
  }
}
/* ==========================================================================
   15. Меню пользователя («Логин ☰» + бейдж), сохранение сравнений и Личный кабинет
   ========================================================================== */

.user-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.login-btn.is-logged-in {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 11px;
}

.um-login {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.um-bars {
  font-size: 13px;
  line-height: 1;
  opacity: 0.92;
}

.um-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e53955;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 196px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-dropdown[hidden] {
  display: none;
}

.user-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.user-dd-item:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-color);
}

.user-dd-item.danger {
  color: #ff7a89;
}

body.theme-light .user-dd-item.danger {
  color: #b82538;
}

.um-dd-badge,
.cab-nav-badge,
.cab-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e53955;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.cab-nav-badge {
  margin-left: auto;
}

.cab-nav-badge[hidden],
.cab-inline-badge[hidden] {
  display: none;
}

#saveComparison {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 5px;
}

.modal-err {
  color: #ff7a89 !important;
  font-size: 12px !important;
  margin: 6px 0 0 !important;
}

body.theme-light .modal-err {
  color: #b82538 !important;
}

.err-models-preview {
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  font-size: 11.5px;
  color: var(--muted);
}

.err-models-preview > span {
  display: block;
  margin-bottom: 6px;
}

/* Страница Личного кабинета (cabinet.php) */
.cabinet-layout {
  grid-template-columns: 235px minmax(0, 1fr);
}

.cabinet-main {
  min-height: 0;
}

.cabinet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.cab-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.cab-title {
  margin: 0;
  font-size: 21px;
  color: var(--text);
}

.cab-title span {
  color: var(--cyan);
}

.cab-subtitle {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.cab-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cab-header-actions a {
  text-decoration: none;
}

.cab-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cab-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}

.cab-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.cab-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cab-card-head h3 {
  margin: 0;
}

.cab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cab-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.cab-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.cab-row-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cab-sm {
  padding: 5px 9px !important;
  font-size: 11px !important;
  border-radius: 7px !important;
  text-decoration: none;
}

.cab-danger {
  border-color: #6b3341 !important;
  color: #ff8c99 !important;
}

body.theme-light .cab-danger {
  border-color: #d18691 !important;
  color: #a81c2e !important;
  background: #fcecef !important;
}

.cab-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cab-subcard {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}

.cab-subcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.cab-date {
  font-size: 11.5px;
}

.cab-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge-blue-bg);
  color: var(--badge-blue-color);
  font-size: 11px;
  font-weight: 700;
}

.cab-author {
  font-size: 12.5px;
  color: var(--text);
  margin-left: 4px;
}

.cab-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.cab-status.ok {
  background: var(--badge-bg);
  color: var(--badge-color);
}

.cab-status.wait {
  background: rgba(255, 207, 112, 0.16);
  color: var(--yellow);
}

.cab-err-text {
  margin: 6px 0 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cab-models-box {
  margin-top: 6px;
  font-size: 11.5px;
}

.cab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.cab-chip {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.cab-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cab-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.cab-note-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.cab-note-card.is-unread {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 35%, transparent);
}

.cab-note-thumb {
  height: 170px;
  padding: 8px;
  background-color: var(--draw-paper-bg);
  background-image:
    linear-gradient(to right, transparent 0, transparent 23px, var(--draw-paper-margin) 24px, var(--draw-paper-margin) 25px, transparent 26px),
    repeating-linear-gradient(to bottom, var(--draw-paper-bg) 0, var(--draw-paper-bg) 23px, var(--draw-paper-line) 24px, var(--draw-paper-line) 25px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  border-bottom: 1px solid var(--line);
}

.cab-note-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cab-note-preview-big {
  max-height: 62vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--draw-paper-border);
  border-radius: 10px;
  background-color: var(--draw-paper-bg);
  background-image:
    linear-gradient(to right, transparent 0, transparent 23px, var(--draw-paper-margin) 24px, var(--draw-paper-margin) 25px, transparent 26px),
    repeating-linear-gradient(to bottom, var(--draw-paper-bg) 0, var(--draw-paper-bg) 23px, var(--draw-paper-line) 24px, var(--draw-paper-line) 25px);
  text-align: center;
}

.cab-note-preview-big img {
  max-width: 100%;
  height: auto;
}

.cab-note-body {
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cab-note-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.cab-note-comment {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel2);
  padding: 6px 8px;
  border-radius: 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cab-empty,
.cab-empty-sm {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.cab-auth-gate {
  max-width: 420px;
  margin: 30px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
}

.cab-auth-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.cab-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cab-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.cab-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--modal-input-border);
  border-radius: 8px;
  background: var(--modal-input-bg);
  color: var(--text);
  outline: none;
}

.cab-field input:focus {
  border-color: var(--cyan);
}

.cab-profile-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}

.cab-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.cab-switch input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.cab-ok {
  margin: 6px 0 0;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 600;
}

.cab-err {
  margin: 4px 0 0;
  color: #ff7a89;
  font-size: 12.5px;
}

body.theme-light .cab-err {
  color: #b82538;
}

@media (max-width: 900px) {
  .cab-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cabinet-scroll {
    padding: 12px;
  }
  .um-login {
    max-width: 82px;
  }
  .table-bottom .bottom-actions #saveComparison {
    flex: 0 0 auto;
  }
}
/* ==========================================================================
   16. Исправление [hidden], кликабельные чипы моделей и управление пользователями
   ========================================================================== */

[hidden] {
  display: none !important;
}

.cab-chip-btn {
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}

.cab-chip-btn:hover {
  border-color: var(--cyan);
  background: var(--nav-hover-bg);
  color: var(--nav-hover-color);
}

.cab-chip-btn.picked {
  border-color: var(--green);
  background: var(--badge-bg);
  color: var(--badge-color);
  transform: scale(0.97);
}

.cab-nav-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.cab-users-head {
  flex-wrap: wrap;
}

.cab-search-input {
  min-width: 220px;
  max-width: 300px;
  padding: 7px 11px;
  border: 1px solid var(--modal-input-border);
  border-radius: 8px;
  background: var(--modal-input-bg);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}

.cab-search-input:focus {
  border-color: var(--cyan);
}

.cab-user-card.is-blocked {
  border-color: #8c3445;
  opacity: 0.9;
}

.cab-status.blocked {
  background: rgba(229, 57, 85, 0.2);
  color: #ff7a89;
}

body.theme-light .cab-status.blocked {
  background: #fcecef;
  color: #a81c2e;
}

.cab-role-sel {
  max-width: 155px;
  padding: 5px 8px;
  font-size: 11.5px;
}

.cab-perms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.cab-perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.cab-perm-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .cab-perms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .cab-perms-grid {
    grid-template-columns: 1fr;
  }
  .cab-search-input {
    width: 100%;
    max-width: none;
  }
}
/* ==========================================================================
   17. Статьи, гайды и каталог материалов (articles.html и /articles/*.html)
   ========================================================================== */

@media (min-width: 1151px) {
  .article-app {
    grid-template-rows: 64px minmax(0, 1fr) auto;
  }
  .article-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

.article-main {
  min-height: 0;
}

.article-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 30px 34px;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.art-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.art-breadcrumbs a {
  color: var(--cyan);
  text-decoration: none;
}

.art-breadcrumbs a:hover {
  text-decoration: underline;
}

.art-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.art-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--badge-blue-bg);
  color: var(--badge-blue-color);
  font-size: 11px;
  font-weight: 700;
}

.art-read-time {
  font-size: 12px;
  color: var(--muted);
}

.art-h1 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.24;
  color: var(--text);
  max-width: 900px;
}

.art-lead {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.58;
  color: var(--muted);
  max-width: 860px;
}

.art-cover-wrap {
  margin: 0 0 20px;
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel2);
}

.art-cover-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.art-cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 860px;
  margin: 0 0 22px;
  padding: 15px 18px;
  border: 1px solid var(--btn-primary-border);
  border-radius: 13px;
  background: var(--panel2);
}

.art-cta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 470px;
}

.art-cta-info strong {
  font-size: 14.5px;
  color: var(--text);
}

.art-cta-info span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.art-cta-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.art-cta-btns a {
  text-decoration: none;
}

.art-table-wrap {
  max-width: 860px;
  margin: 0 0 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.art-table th,
.art-table td {
  padding: 10px 13px;
  text-align: left;
  border-bottom: 1px solid var(--td-border-b);
  border-right: 1px solid var(--td-border-r);
}

.art-table th:last-child,
.art-table td:last-child {
  border-right: 0;
}

.art-table tr:last-child td {
  border-bottom: 0;
}

.art-table thead th {
  background: var(--th-bg);
  color: var(--th-color);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.art-table tbody td {
  background: var(--td-bg);
  color: var(--td-color);
  line-height: 1.4;
}

.art-table tbody tr:nth-child(even) td {
  background: var(--td-alt);
}

.art-table tbody td:first-child {
  font-weight: 700;
  color: var(--text);
}

.art-prose {
  max-width: 860px;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.7;
}

.art-prose h2 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.3;
  color: var(--cyan);
}

.art-prose p {
  margin: 0 0 12px;
}

.art-prose ul,
.art-prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.art-prose li {
  margin-bottom: 7px;
}

.art-bottom-cta {
  max-width: 860px;
  margin: 28px 0 26px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
}

.art-bottom-cta h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
  color: var(--text);
}

.art-bottom-cta p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.art-related {
  max-width: 860px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.art-related h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
}

.art-rel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.art-rel-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.art-rel-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.art-rel-cat {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.art-rel-card strong {
  font-size: 13.5px;
  line-height: 1.38;
  color: var(--text);
}

.art-rel-more {
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}

/* Каталог статей (articles.html) */
.hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.hub-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-head-actions a {
  text-decoration: none;
}

.hub-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hub-search {
  min-width: 240px;
  flex: 0 1 320px;
  padding: 8px 12px;
  border: 1px solid var(--modal-input-border);
  border-radius: 9px;
  background: var(--modal-input-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.hub-search:focus {
  border-color: var(--cyan);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel2);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.hub-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.hub-thumb {
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.hub-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 15px 15px;
  flex: 1;
}

.hub-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hub-card-body h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}

.hub-card-body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.hub-card-more {
  margin-top: auto;
  padding-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}

.hub-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .art-rel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .article-scroll {
    padding: 14px 14px 24px;
  }
  .hub-search {
    width: 100%;
    flex: 1 1 100%;
  }
  .art-cta-box {
    padding: 13px 14px;
  }
}
