*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.62);
  --text-soft: rgba(255, 255, 255, 0.78);
  --page-bg: #050505;
  --glass-bg: rgba(28, 28, 30, 0.42);
  --glass-bg-strong: rgba(32, 32, 34, 0.55);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px rgba(0, 0, 0, 0.28);
  --field-bg: rgba(0, 0, 0, 0.28);
  --field-border: rgba(255, 255, 255, 0.14);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --table-line: rgba(255, 255, 255, 0.1);
  --btn-secondary-bg: rgba(255, 255, 255, 0.1);
  --btn-secondary-border: rgba(255, 255, 255, 0.16);
  --bg-filter: blur(2px) brightness(0.55) saturate(0.85);
  --vignette:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 35%, rgba(0, 0, 0, 0.55) 100%);
  --switch-track: #1a1a1c;
  --switch-track-border: #0d0d0f;
  --switch-track-text: #ffffff;
  --switch-thumb: #ffffff;
  --switch-thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  --switch-icon: #141418;
  --option-bg: #1a1a1c;
}

html[data-theme="light"] {
  color-scheme: light;
  --text: #16161a;
  --text-muted: rgba(22, 22, 26, 0.62);
  --text-soft: rgba(22, 22, 26, 0.78);
  --page-bg: #e8e6e1;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(20, 20, 24, 0.12);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 18px 40px rgba(40, 30, 20, 0.14);
  --field-bg: rgba(255, 255, 255, 0.72);
  --field-border: rgba(20, 20, 24, 0.14);
  --chip-bg: rgba(20, 20, 24, 0.05);
  --table-line: rgba(20, 20, 24, 0.1);
  --btn-secondary-bg: rgba(20, 20, 24, 0.06);
  --btn-secondary-border: rgba(20, 20, 24, 0.14);
  --bg-filter: blur(2px) brightness(1.08) saturate(0.92);
  --vignette:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(255, 255, 255, 0.35) 0%, rgba(232, 230, 225, 0.45) 55%, rgba(220, 216, 208, 0.72) 100%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 40%, rgba(210, 205, 195, 0.45) 100%);
  --switch-track: #ececef;
  --switch-track-border: rgba(20, 20, 24, 0.14);
  --switch-track-text: #141418;
  --switch-thumb: #ffffff;
  --switch-thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  --switch-icon: #141418;
  --option-bg: #ffffff;
}

body {
  position: relative;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
  min-height: 100vh;
  transition: color 1.6s ease, background-color 1.6s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    url("./assets/bg-library.jpg") center center / cover no-repeat;
  transform: scale(1.04);
  filter: var(--bg-filter);
  z-index: 0;
  transition: filter 0.45s ease;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--vignette);
  transition: opacity 0.45s ease;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 52px 0;
  background: transparent;
  pointer-events: none;
}

.topbar-left,
.topbar .brand,
.topbar .brand-logo,
.topbar .brand-title,
.topbar .auth-actions,
.topbar .auth-actions .user-actions,
.topbar .auth-actions a,
.topbar .auth-actions button {
  pointer-events: auto;
}

.topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

/* Desktop: theme switch stays in topbar-left next to brand; high z so it stays clickable. */
.theme-switch {
  position: relative;
  z-index: 50000;
  pointer-events: auto;
  align-self: center;
  line-height: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-logo {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
}

.brand-title {
  color: var(--text);
  text-decoration: none;
}

.brand-title:hover {
  color: var(--text);
  opacity: 0.88;
}

html[data-theme="light"] .brand-title {
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  filter: none;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-actions {
  display: inline-flex;
  align-items: stretch;
  gap: 10px;
}

.user-actions[hidden] {
  display: none !important;
}

/* Desktop: hide chrome until auth (no empty tile gap). Mobile overrides to reserve slots. */
body:not(.is-authenticated) .user-actions {
  display: none !important;
}

.auth-tile {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  min-height: 72px;
  padding: 10px 12px 9px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-soft);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.auth-tile:hover {
  color: var(--text);
  background: var(--glass-bg-strong);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

html[data-theme="light"] .auth-tile:hover {
  border-color: rgba(20, 20, 24, 0.18);
}

.auth-tile.is-active {
  color: var(--text);
  background: var(--glass-bg-strong);
  border-color: rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] .auth-tile.is-active {
  border-color: rgba(20, 20, 24, 0.18);
}

.auth-tile-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.auth-tile-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.auth-tile-label {
  display: block;
}

.admin-sep[hidden] {
  display: none !important;
}

/* Access/admin chrome: visibility only (see rules above) — avoid display:none reflow. */
.admin-link[hidden] {
  display: inline-flex !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

[data-access][hidden] {
  display: revert !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Nav tiles: Главная | Профиль | Поддержка (+ Админка/Выйти where shown). */
.user-actions .home-link {
  order: 1;
}

.user-actions .profile-link {
  order: 2;
}

.user-actions .support-widget-btn {
  order: 3;
}

.user-actions .admin-link {
  order: 4;
}

.user-actions .logout-btn {
  order: 5;
}

.home-link {
  display: none;
}

body.is-authenticated .home-link {
  display: inline-flex;
}

/* Tab-bar «ВВЕРХ» removed for regular users; download links live in explore popup. */
.vverh-app-link {
  display: none !important;
}

#download-vverh-modal .info-modal-panel {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
}

#download-vverh-modal .info-modal-head {
  justify-content: center;
  position: relative;
  margin-bottom: 20px;
}

#download-vverh-modal .info-modal-title {
  width: 100%;
  text-align: center;
  padding: 0;
}

.download-vverh-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 0 12px;
  box-sizing: border-box;
}

#download-vverh-modal a.download-vverh-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  min-height: 52px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.16));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #fff);
  font: inherit;
  font-size: 17px;
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  padding: 14px 18px;
}

#download-vverh-modal a.download-vverh-btn .download-vverh-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: inherit;
}

#download-vverh-modal a.download-vverh-btn .download-vverh-btn-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

#download-vverh-modal a.download-vverh-btn .download-vverh-btn-label {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}

#download-vverh-modal a.download-vverh-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text, #fff);
}

#download-vverh-modal a.download-vverh-btn:active {
  transform: scale(0.98);
}

html[data-theme="light"] #download-vverh-modal a.download-vverh-btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.05);
  color: var(--text, #111);
}

html[data-theme="light"] #download-vverh-modal a.download-vverh-btn:hover {
  background: rgba(15, 23, 42, 0.09);
}

.admin-action.profile-logout-btn,
.admin-action.secondary.profile-logout-btn {
  margin-top: 10px;
  border-color: rgba(220, 60, 60, 0.55) !important;
  background: rgba(220, 55, 55, 0.22) !important;
  color: #ff6b6b !important;
}

.admin-action.profile-logout-btn:hover,
.admin-action.secondary.profile-logout-btn:hover {
  border-color: rgba(220, 60, 60, 0.8) !important;
  background: rgba(220, 55, 55, 0.34) !important;
  color: #ff8a8a !important;
}

html[data-theme="light"] .admin-action.profile-logout-btn,
html[data-theme="light"] .admin-action.secondary.profile-logout-btn {
  border-color: rgba(200, 40, 40, 0.5) !important;
  background: rgba(220, 50, 50, 0.12) !important;
  color: #c62828 !important;
}

html[data-theme="light"] .admin-action.profile-logout-btn:hover,
html[data-theme="light"] .admin-action.secondary.profile-logout-btn:hover {
  background: rgba(220, 50, 50, 0.2) !important;
  color: #b71c1c !important;
}

#logout-confirm-modal [data-logout-confirm-yes] {
  background: #e53935;
  color: #fff;
}

#logout-confirm-modal [data-logout-confirm-yes]:hover {
  background: #d32f2f;
}

.auth-sep {
  display: none;
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
}

.search-stack {
  /* 6 блоков × 188px + 5 промежутков × 14px = 1198px */
  --explore-row-width: calc(6 * 188px + 5 * 14px);
  width: min(var(--explore-row-width), 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
}

.search-wrap {
  position: relative;
  width: 100%;
}

.glass,
.search-bar {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow: var(--glass-shadow);
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    color 0.35s ease;
}

.search-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 68px;
  padding: 0 12px 0 20px;
  border-radius: 18px;
  cursor: text;
}

.search-bar:focus-within {
  border-color: var(--text-muted);
  background: var(--glass-bg-strong);
}

#kb-search {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: left;
}

#kb-search::placeholder {
  color: var(--text-muted);
  text-align: left;
}

.search-ai-btn {
  appearance: none;
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

html[data-theme="light"] .search-ai-btn {
  border-color: rgba(20, 20, 24, 0.12);
  background: rgba(20, 20, 24, 0.05);
}

.search-ai-btn:hover {
  color: var(--text);
}

.search-ai-btn[aria-pressed="true"] {
  /* тёмная тема сайта → светлая кнопка */
  background: #f4f4f5;
  border-color: #f4f4f5;
  color: #111;
}

html[data-theme="light"] .search-ai-btn[aria-pressed="true"] {
  /* светлая тема сайта → тёмная кнопка */
  background: #17171a;
  border-color: #17171a;
  color: #f5f5f5;
}

.search-ai-btn.is-inactive-feature {
  opacity: 0.92;
}

#kb-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 5;
  border-radius: 18px;
  overflow: hidden;
  padding: 5px 0;
}

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

.search-item {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font: inherit;
  font-size: 18px;
  font-weight: 450;
  color: var(--text-soft);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--table-line);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-item:first-child {
  border-top: 0;
}

.search-item:hover,
.search-item.is-active {
  background: var(--chip-bg);
}

.search-item-left {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.search-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-item-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.search-empty {
  padding: 18px 20px;
  font-size: 18px;
  color: var(--text-muted);
  text-align: center;
}

.icon-doc {
  width: 23px;
  height: 23px;
  color: var(--text-muted);
}

.icon-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.explore {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}

.explore-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.explore-links {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  width: auto;
  max-width: 100%;
}

.explore-links a,
.explore-links .explore-link {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px 12px;
  margin: 0;
  width: 168px;
  max-width: 168px;
  min-width: 0;
  min-height: 128px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  line-height: 1.25;
  white-space: normal;
}

.explore-links a:hover,
.explore-links .explore-link:hover {
  color: var(--text);
  background: var(--glass-bg-strong);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

html[data-theme="light"] .explore-links a:hover,
html[data-theme="light"] .explore-links .explore-link:hover {
  border-color: rgba(20, 20, 24, 0.18);
}

.explore-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

html[data-theme="light"] .explore-icon {
  background: rgba(20, 20, 24, 0.07);
  border-color: rgba(20, 20, 24, 0.12);
}

.explore-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}

.explore-link-label {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
}

.explore-link-articles-hub,
.explore-link-changes {
  position: relative;
}

.changes-alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  /* тёмная тема: белый круг, тёмный знак */
  background: #fff;
  color: #111;
}

.changes-alert-badge[hidden] {
  display: none !important;
}

html[data-theme="light"] .changes-alert-badge {
  /* светлая тема: чёрный круг, белый знак */
  background: #111;
  color: #fff;
}

.articles-hub-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.articles-hub-tabs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.articles-hub-tab {
  appearance: none;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 10px 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.articles-hub-tab.is-active {
  color: #fff;
  border-bottom-color: #fff;
}

html[data-theme="light"] .articles-hub-tab.is-active {
  color: #111;
  border-bottom-color: #111;
}

.articles-hub-tab-badge {
  top: 2px;
  right: 4px;
}

.articles-hub-panels {
  flex: 0 0 auto;
  width: 100%;
  height: min(70vh, 680px);
  min-height: min(70vh, 680px);
  max-height: min(70vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.articles-hub-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.articles-hub-panel[hidden] {
  display: none !important;
}

.articles-hub-panel.favorites-menu-body,
.articles-hub-panel.changes-menu-body {
  overflow: auto;
  max-height: none;
  height: 100%;
  padding: 8px 4px 16px;
}

/* Mobile breakpoints live in styles.mobile.css */

body.is-auth-required .stage,
body.is-auth-required .topbar .auth-actions {
  pointer-events: none;
}

/* Keep chrome slots reserved — hide without removing from flex layout. */
body.is-auth-required .support-widget-btn,
body:not(.is-authenticated) .support-widget-btn,
body:not([data-role="admin"]) .admin-link,
body:not(.is-authenticated) [data-access],
[data-access].is-access-denied {
  visibility: hidden !important;
  pointer-events: none !important;
}

.profile-stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 32px 48px;
}

.profile-card {
  width: min(960px, 100%);
  border-radius: 18px;
  padding: 28px 24px 24px;
}

.profile-head {
  margin-bottom: 20px;
}

.profile-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.profile-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.admin-live {
  margin: 0;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

html[data-theme="light"] .admin-live {
  color: rgba(20, 20, 24, 0.72);
}

.profile-user {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.profile-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.profile-tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.profile-panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 500;
}

.profile-panel p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .profile-panel p {
  color: rgba(22, 22, 26, 0.72);
}

.profile-panel[hidden] {
  display: none;
}

.admin-card {
  width: min(1100px, 100%);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
}

.admin-table th {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-table th.admin-metric-cell,
.admin-table td.admin-metric-cell {
  text-align: center;
}

.admin-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.admin-sort-btn.is-active {
  color: var(--accent, #5b9dff);
}

.admin-sort-btn.is-active::after {
  content: "↓";
  font-size: 11px;
  opacity: 0.9;
}

.admin-sort-btn.is-active[data-sort-dir="asc"]::after {
  content: "↑";
}

.admin-metrics-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.admin-metrics-subtab,
.admin-metrics-toggle {
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.16));
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #fff);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.admin-metrics-subtab.is-active,
.admin-metrics-toggle.is-active {
  background: rgba(91, 157, 255, 0.22);
  border-color: rgba(91, 157, 255, 0.55);
}

.admin-metrics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-metrics-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-metrics-hint {
  margin: 0;
  opacity: 0.72;
  font-size: 13px;
}

.admin-metrics-chart-wrap {
  width: 100%;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14));
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 8px 4px;
  margin-bottom: 16px;
}

#admin-metrics-chart {
  display: block;
  width: 100%;
  height: auto;
}

.admin-metrics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.admin-metrics-card {
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14));
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-metrics-card-label {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
}

.admin-metrics-card-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

html[data-theme="light"] .admin-metrics-subtab,
html[data-theme="light"] .admin-metrics-toggle,
html[data-theme="light"] .admin-metrics-chart-wrap,
html[data-theme="light"] .admin-metrics-card {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.12);
  color: inherit;
}

html[data-theme="light"] .admin-metrics-subtab.is-active,
html[data-theme="light"] .admin-metrics-toggle.is-active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

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

.support-status-new {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #111;
  background: #fbbf24;
}

.admin-table tr.is-support-pinned td {
  background: rgba(251, 191, 36, 0.08);
}

.admin-table tr.is-support-new td:first-child {
  font-weight: 600;
}

html[data-theme="light"] .admin-table tr.is-support-pinned td {
  background: rgba(245, 158, 11, 0.1);
}

.admin-action {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.admin-action.secondary {
  background: transparent;
}

.admin-action:hover {
  background: rgba(255, 255, 255, 0.18);
}

.admin-ai-logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  margin: 12px 0 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-ai-logs-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.admin-ai-logs-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-soft, rgba(255, 255, 255, 0.78));
  cursor: pointer;
}

.admin-ai-logs-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
}

.admin-ai-logs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.admin-ai-logs-field input[type="date"] {
  appearance: none;
  min-width: 160px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text, #fff);
  font: inherit;
  font-size: 14px;
}

html[data-theme="light"] .admin-ai-logs-toolbar {
  background: rgba(20, 20, 24, 0.03);
  border-color: rgba(20, 20, 24, 0.1);
}

html[data-theme="light"] .admin-ai-logs-field {
  color: rgba(20, 20, 24, 0.55);
}

html[data-theme="light"] .admin-ai-logs-field input[type="date"] {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 20, 24, 0.14);
  color: #17171a;
}

.admin-ai-logs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.admin-logs-more-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0 4px;
}

.admin-muted {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.user-card-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-reset-request,
.user-reset-pending {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.user-reset-request {
  color: #111;
  background: #f5c842;
}

.user-reset-pending {
  color: #fff;
  background: rgba(59, 130, 246, 0.75);
}

#password-change-status {
  margin-top: 10px;
}

#password-change-status.is-error {
  color: #f87171;
}

.profile-settings-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 0;
}

.profile-settings-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.profile-settings-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

html[data-theme="light"] .profile-settings-heading {
  color: rgba(17, 24, 39, 0.9);
}

html[data-theme="light"] .profile-settings-text {
  color: rgba(17, 24, 39, 0.62);
}

.profile-progress-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  margin-left: auto;
  flex: 1 1 320px;
  min-width: min(100%, 280px);
  max-width: 100%;
}

.profile-progress-label {
  flex: 0 0 auto;
  height: 22px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 560;
  line-height: 1;
  color: var(--text-soft);
  margin-right: 2px;
}

.profile-progress-track {
  position: relative;
  flex: 1 1 auto;
  width: auto;
  min-width: 160px;
  max-width: none;
  height: 22px;
  margin: 0 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.profile-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6fed, #5b8dff);
  transition: width 0.25s ease;
}

.profile-progress-points {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.profile-progress-level,
.profile-progress-next {
  flex: 0 0 auto;
  min-width: 1.25em;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.profile-progress-next {
  color: var(--text-soft);
}

.points-ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.points-ledger-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.points-ledger-delta {
  flex: 0 0 auto;
  min-width: 3.2em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.points-ledger-delta.is-plus {
  color: #4ade80;
}

.points-ledger-delta.is-minus {
  color: #f87171;
}

.points-ledger-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

html[data-theme="light"] .profile-progress-track {
  background: rgba(20, 20, 24, 0.08);
  border-color: rgba(20, 20, 24, 0.12);
}

html[data-theme="light"] .profile-progress-points {
  color: #141418;
  text-shadow: none;
}

html[data-theme="light"] .points-ledger-row {
  background: rgba(20, 20, 24, 0.03);
}

html[data-theme="light"] .points-ledger-delta.is-plus {
  color: #15803d;
}

html[data-theme="light"] .points-ledger-delta.is-minus {
  color: #b91c1c;
}

.admin-stage {
  align-items: flex-start;
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.layout-card {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layout-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.layout-card strong {
  font-size: 13px;
}

.layout-card span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.35;
}

.layout-card.is-active {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.article-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.article-form[hidden] {
  display: none !important;
}

body.popup-edit-open {
  overflow: hidden;
}

#popup-edit-modal {
  z-index: 50;
}

#popup-edit-modal[hidden] {
  display: none !important;
}

.popup-edit-panel {
  width: min(760px, 100%);
  min-height: 0;
  max-height: min(92vh, 900px);
  overflow: auto;
}

.popup-rich-surface {
  min-height: 240px;
  max-height: min(48vh, 420px);
  overflow: auto;
}

.popup-rich-surface img,
.popup-rich-surface video,
.rich-surface img,
.rich-surface video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem 0;
  border-radius: 10px;
}

.popup-rich-surface video,
.rich-surface video {
  width: 100%;
  max-height: 320px;
  background: #000;
}

.article-form textarea,
.article-form select,
.article-form input[type="text"],
.auth-field select,
.articles-filters select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  resize: vertical;
}

.auth-field select,
.articles-filters select,
.article-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.7) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 50%, transparent 50%),
    linear-gradient(to right, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}

.auth-field select:focus,
.articles-filters select:focus,
.article-form select:focus {
  border-color: rgba(255, 255, 255, 0.32);
  background-color: rgba(32, 32, 34, 0.55);
}

.auth-field select option,
.articles-filters select option,
.article-form select option {
  background: #1a1a1c;
  color: #fff;
}

.article-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.article-form-head .profile-user {
  margin: 0;
}

.article-memo-panel {
  width: min(620px, 100%);
  max-height: min(84vh, 820px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 18px 16px;
}

.info-modal-body.article-memo-body {
  overflow: auto;
  min-height: 0;
  flex: 1;
  white-space: normal;
  text-align: left;
  padding-right: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}

.article-memo-body > *:first-child {
  margin-top: 0;
}

.article-memo-body h3 {
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.article-memo-body p {
  margin: 0 0 6px;
}

.article-memo-body ul {
  margin: 0 0 6px;
  padding-left: 1.15em;
}

.article-memo-body li {
  margin: 0 0 3px;
}

.article-memo-body li:last-child {
  margin-bottom: 0;
}

.article-memo-body .memo-lead {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.article-memo-body .memo-note {
  margin: 4px 0 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.article-memo-panel .article-form-footer {
  margin-top: 10px;
  padding-top: 12px;
}

.contour-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.contour-btn {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 58px;
  margin: 0;
  padding: 8px 6px;
  border: 1px solid var(--field-border, rgba(255, 255, 255, 0.14));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft, rgba(255, 255, 255, 0.72));
  cursor: pointer;
  text-align: center;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.contour-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.contour-btn.is-active {
  border-color: rgba(120, 180, 255, 0.65);
  background: rgba(70, 130, 220, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(120, 180, 255, 0.25);
}

.contour-btn-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.contour-btn-level {
  font-size: 10px;
  line-height: 1.25;
  opacity: 0.78;
  font-weight: 400;
}

html[data-theme="light"] .contour-btn {
  background: rgba(0, 0, 0, 0.03);
  color: rgba(20, 24, 32, 0.78);
}

html[data-theme="light"] .contour-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(20, 24, 32, 0.95);
}

html[data-theme="light"] .contour-btn.is-active {
  border-color: rgba(40, 110, 210, 0.55);
  background: rgba(70, 140, 230, 0.14);
  color: rgba(20, 40, 80, 0.95);
}

.article-toc-preview {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--field-border, rgba(255, 255, 255, 0.14));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.article-toc-preview .auth-label {
  margin: 0;
}

.article-toc-preview-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.4;
}

.article-toc-preview-list[hidden],
.article-toc-preview .shots-hint[hidden] {
  display: none !important;
}

.article-toc-preview-list li + li {
  margin-top: 2px;
}

.article-toc-preview .shots-hint {
  margin: 0;
}

.rich-btn-toc {
  border-color: rgba(255, 255, 255, 0.28);
}

.rich-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rich-select-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.rich-select,
.rich-number {
  appearance: none;
  border: 1px solid var(--btn-secondary-border, rgba(255, 255, 255, 0.16));
  background: var(--btn-secondary-bg, rgba(255, 255, 255, 0.1));
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  max-width: 132px;
}

.rich-select {
  padding-right: 24px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.7) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 12px) calc(50% - 2px),
    calc(100% - 7px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.rich-number {
  width: 72px;
  max-width: 72px;
  cursor: text;
}

.rich-number::-webkit-outer-spin-button,
.rich-number::-webkit-inner-spin-button {
  margin: 0;
}

.auth-submit-preview {
  background: #2f6fed;
  color: #fff;
  border-color: #2f6fed;
}

.auth-submit-preview:hover {
  background: #2560d6;
  border-color: #2560d6;
}

.article-preview-panel {
  width: min(1100px, 100%);
  max-height: min(90vh, 920px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 18px 12px;
}

.article-preview-head {
  margin-bottom: 8px;
  flex-shrink: 0;
}

#article-preview-modal .kb-modal-body {
  flex: 1;
  min-height: 0;
}

#article-preview-modal {
  z-index: 55;
}

#article-preview-modal .kb-suggest-btn {
  display: none;
}

.rich-select option {
  background: var(--option-bg, #1a1a1c);
  color: var(--text);
}

.rich-color-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rich-swatch {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--swatch, #fff);
  cursor: pointer;
  padding: 0;
}

.rich-swatch[data-rich-hilite="transparent"] {
  background:
    linear-gradient(45deg, #666 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(-45deg, #666 25%, transparent 25%) 0 4px / 8px 8px,
    #222;
}

.rich-editor {
  display: grid;
  gap: 0;
  border: 1px solid var(--field-border, rgba(255, 255, 255, 0.14));
  border-radius: 12px;
  background: var(--field-bg, rgba(0, 0, 0, 0.28));
  overflow: hidden;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--table-line, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.03);
}

.rich-btn {
  appearance: none;
  border: 1px solid var(--btn-secondary-border, rgba(255, 255, 255, 0.16));
  background: var(--btn-secondary-bg, rgba(255, 255, 255, 0.1));
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
}

.rich-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.rich-btn.is-active {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.18);
}

.rich-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 2px;
  background: var(--table-line, rgba(255, 255, 255, 0.12));
}

.rich-surface {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  outline: none;
}

.rich-surface:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.rich-surface p,
.kb-section-rich p {
  margin: 0 0 0.75em;
}

.rich-surface p:last-child,
.kb-section-rich p:last-child {
  margin-bottom: 0;
}

.rich-surface h2,
.kb-section-rich h2 {
  margin: 0 0 0.55em;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.rich-surface h3,
.kb-section-rich h3 {
  margin: 0 0 0.5em;
  font-size: 1.05rem;
  font-weight: 600;
}

.rich-surface ul,
.rich-surface ol,
.kb-section-rich ul,
.kb-section-rich ol {
  margin: 0 0 0.75em;
  padding-left: 1.35em;
}

.rich-surface li + li,
.kb-section-rich li + li {
  margin-top: 0.25em;
}

.rich-surface a,
.kb-section-rich a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-surface table,
.kb-section-rich table,
.rich-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.9em;
  font-size: 14px;
}

.rich-surface th,
.rich-surface td,
.kb-section-rich th,
.kb-section-rich td {
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.16));
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}

.rich-surface th,
.kb-section-rich th {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}

.kb-section-rich {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-soft);
}

html[data-theme="light"] .rich-surface th,
html[data-theme="light"] .kb-section-rich th {
  background: rgba(20, 20, 24, 0.05);
}

html[data-theme="light"] .rich-swatch {
  border-color: rgba(20, 20, 24, 0.2);
}

html[data-theme="light"] .rich-btn:hover,
html[data-theme="light"] .rich-btn.is-active {
  border-color: rgba(20, 20, 24, 0.22);
  background: rgba(20, 20, 24, 0.08);
}

html[data-theme="light"] .rich-toolbar {
  background: rgba(20, 20, 24, 0.03);
}

.article-form-error {
  margin: 12px 0 0;
  text-align: left;
}

.article-form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: rgba(18, 18, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-left: -4px;
  margin-right: -4px;
  padding-left: 4px;
  padding-right: 4px;
  padding-bottom: 4px;
}

.article-form-footer .auth-submit {
  min-width: 140px;
}

.shots-hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.shots-field {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.shot-add-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.shot-add-label.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.auth-field input.shot-file-input,
.article-form input.shot-file-input[type="file"],
.shot-add-label .shot-file-input,
.shot-file-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  border: 0 !important;
  cursor: pointer !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0 !important;
  color: transparent !important;
  z-index: 2;
}

.shot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.shot-actions .admin-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.shots-carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 2px 8px;
  margin-top: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.shots-carousel::-webkit-scrollbar {
  height: 6px;
}

.shots-carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.shots-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.shots-empty {
  margin: 12px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.shot-card {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.shot-card .shot-btn-full {
  width: 100%;
}

.shot-card img,
.shot-card video,
.shot-card-video {
  width: 100%;
  height: 140px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  background-size: 200% 100%;
}

.shot-card img.is-ready,
.shot-card video.is-ready,
.shot-card-video.is-ready {
  background: rgba(0, 0, 0, 0.28);
}

.shot-card img[data-media-open] {
  cursor: zoom-in;
}

.shot-card-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.shot-controls-move {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.shot-btn-half,
.shot-btn-full {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.shot-btn-full {
  margin-top: 0;
}

.articles-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.filter-field {
  min-width: 0;
}

.filter-search-wrap {
  grid-column: 1 / -1;
}

.admin-mini-search {
  height: 48px;
  border-radius: 14px;
  padding: 0 14px;
}

.admin-mini-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
}

.admin-mini-search input::placeholder {
  color: var(--text-muted);
  text-align: left;
}

.admin-mini-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

body.is-auth-required .stage {
  filter: blur(2px);
  opacity: 0.55;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border-radius: 18px;
  padding: 28px 24px 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.auth-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.auth-brand h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
}

.auth-lead {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.auth-lead.auth-lead-emphasis {
  margin: 6px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.auth-register-notice {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.auth-register-notice[hidden] {
  display: none !important;
}

.auth-register-notice strong {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrap input {
  padding-right: 44px;
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.auth-password-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.auth-password-toggle[hidden] {
  display: none !important;
}

.auth-eye-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field[hidden],
#auth-confirm-wrap[hidden],
.auth-submit[hidden] {
  display: none !important;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(255, 255, 255, 0.32);
}

.auth-field input.is-invalid {
  border-color: rgba(248, 113, 113, 0.65);
}

.auth-field-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-field-hint[hidden] {
  display: none !important;
}

.auth-field-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #fecaca;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.auth-field-error[hidden] {
  display: none;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.auth-submit {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 13px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #111;
  background: #fff;
  cursor: pointer;
}

.auth-submit:hover {
  background: rgba(255, 255, 255, 0.92);
}

.auth-submit-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-submit-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

body.logout-confirm-open {
  overflow: hidden;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.confirm-modal-panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  border-radius: 18px;
  padding: 22px 22px 20px;
}

.confirm-modal-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.confirm-modal-text {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted, rgba(255, 255, 255, 0.72));
}

.confirm-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.confirm-modal-actions .auth-submit {
  min-width: 110px;
}

/* Knowledge article / snippet popups */
body.kb-open {
  overflow: hidden;
}

.kb-modal {
  position: fixed;
  inset: 0;
  /* Above topbar (210) / .user-actions so the article covers header controls on desktop. */
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

.kb-modal[hidden] {
  display: none !important;
}

.kb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.kb-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: min(88vh, 900px);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kb-modal-body {
  overflow: auto;
  max-height: inherit;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.kb-modal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.kb-panel {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.kb-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.kb-toc {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.kb-toc::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.glass-soft {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.kb-article {
  display: grid;
  grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
  min-height: 520px;
}

.kb-toc {
  padding: 22px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
}

.kb-toc-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 14px 8px;
}

.kb-toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kb-toc-item {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.kb-toc-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.kb-toc-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.75);
}

.kb-toc-num {
  flex: 0 0 auto;
  width: 18px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.kb-toc-item.is-active .kb-toc-num {
  color: rgba(255, 255, 255, 0.85);
}

.kb-toc-empty {
  margin: 0;
  padding: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

html[data-theme="light"] .kb-toc-empty {
  color: #111827;
}

.kb-main {
  padding: 28px 32px 24px;
}

.kb-main h1,
.kb-snippet h1 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kb-article-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 12px;
  margin: 0 0 12px;
}

.kb-article-head h1,
.kb-article-head .sections-menu-article-title {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding-right: 4px;
}

.kb-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
}

.kb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.kb-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.kb-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kb-section h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.kb-heading-flash {
  border-radius: 8px;
  padding: 4px 8px;
  margin-left: -8px;
  margin-right: -8px;
  animation: kb-heading-flash 1.8s ease;
}

@keyframes kb-heading-flash {
  0% {
    background-color: rgba(47, 111, 237, 0.42);
    box-shadow: 0 0 0 6px rgba(47, 111, 237, 0.22);
  }
  35% {
    background-color: rgba(47, 111, 237, 0.28);
    box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

html[data-theme="light"] .kb-heading-flash {
  animation-name: kb-heading-flash-light;
}

@keyframes kb-heading-flash-light {
  0% {
    background-color: rgba(47, 111, 237, 0.28);
    box-shadow: 0 0 0 6px rgba(47, 111, 237, 0.16);
  }
  35% {
    background-color: rgba(47, 111, 237, 0.16);
    box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.1);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

.kb-sec-num {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.kb-section p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.kb-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
  align-items: stretch;
}

.kb-shot {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.kb-media-card {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-align: left;
  box-sizing: border-box;
}

.kb-media-card .kb-shot {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  max-width: none;
  max-height: none;
  margin: 0;
  pointer-events: none;
  object-fit: contain;
  object-position: center;
}

.kb-media-view-label {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.kb-media-card:hover .kb-media-view-label,
.kb-media-card:focus-visible .kb-media-view-label {
  opacity: 1;
}

.kb-video-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  overflow: hidden;
}

.kb-video-wrap .kb-video {
  position: absolute;
  inset: 8px;
  display: block;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border-radius: 0;
  border: 0;
}

.kb-video-fs {
  appearance: none;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.kb-video-fs:hover {
  background: rgba(0, 0, 0, 0.78);
  border-color: rgba(255, 255, 255, 0.5);
}

.kb-video-fs svg {
  width: 16px;
  height: 16px;
  display: block;
}

.media-viewer-modal {
  position: fixed;
  inset: 0;
  /* Above .kb-modal (220) / tag-feed (260) / suggest (280) so previews cover the article */
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.media-viewer-modal[hidden] {
  display: none !important;
}

.media-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.media-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(86vh, 860px);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
}

.media-viewer-close {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.media-viewer-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.media-viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: min(78vh, 780px);
}

.media-viewer-stage.is-single {
  /* no side gutters when alone */
}

.media-viewer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: min(78vh, 780px);
  min-width: 0;
  width: 100%;
  overflow: auto;
  background: transparent;
}

.media-viewer-body.is-loading .media-viewer-image {
  opacity: 0.55;
}

.media-viewer-skeleton {
  width: min(420px, 70%);
  height: min(280px, 42vh);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  background-size: 200% 100%;
  animation: media-viewer-shimmer 1.1s ease-in-out infinite;
}

.media-viewer-error {
  margin: 0;
  padding: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  text-align: center;
}

@keyframes media-viewer-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.media-viewer-nav {
  appearance: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  box-sizing: border-box;
  width: 52px;
  height: 52px;
  padding: 0;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: none;
}

.media-viewer-nav-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.media-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.media-viewer-nav[hidden] {
  display: none !important;
}

.media-viewer-prev {
  left: 12px;
}

.media-viewer-next {
  right: 12px;
}

.media-viewer-counter {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(235, 242, 255, 0.88);
  letter-spacing: 0.02em;
}

.media-viewer-counter[hidden] {
  display: none !important;
}

.media-viewer-image,
.media-viewer-video {
  display: block;
  max-width: 100%;
  max-height: min(76vh, 760px);
  width: auto;
  height: auto;
  border-radius: 12px;
  background: transparent;
}

.media-viewer-video {
  width: 100%;
}

html[data-theme="light"] .media-viewer-backdrop {
  background: rgba(40, 36, 30, 0.45);
}

html[data-theme="light"] .kb-media-view-label,
html[data-theme="light"] .kb-video-fs,
html[data-theme="light"] .media-viewer-close {
  background: rgba(20, 20, 24, 0.72);
  border-color: rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .media-viewer-nav {
  background: transparent;
  border-color: rgba(20, 20, 24, 0.72);
  color: rgba(20, 20, 24, 0.92);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.65);
}

html[data-theme="light"] .media-viewer-nav:hover {
  background: rgba(20, 20, 24, 0.08);
  border-color: rgba(20, 20, 24, 0.9);
}

html[data-theme="light"] .media-viewer-counter {
  color: rgba(28, 32, 40, 0.88);
  font-weight: 600;
}

html[data-theme="light"] .media-viewer-skeleton {
  background:
    linear-gradient(90deg, rgba(20, 20, 24, 0.06), rgba(20, 20, 24, 0.12), rgba(20, 20, 24, 0.06));
  background-size: 200% 100%;
}

html[data-theme="light"] .media-viewer-error {
  color: rgba(28, 32, 40, 0.72);
}

html[data-theme="light"] .shot-card img,
html[data-theme="light"] .shot-card video,
html[data-theme="light"] .shot-card-video {
  background:
    linear-gradient(90deg, rgba(20, 20, 24, 0.05), rgba(20, 20, 24, 0.1), rgba(20, 20, 24, 0.05));
  background-size: 200% 100%;
  border-color: rgba(20, 20, 24, 0.12);
}

html[data-theme="light"] .shot-card img.is-ready,
html[data-theme="light"] .shot-card video.is-ready,
html[data-theme="light"] .shot-card-video.is-ready {
  background: rgba(20, 20, 24, 0.04);
}

.kb-article-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  justify-content: flex-end;
  flex: 0 0 auto;
  align-self: center;
}

.kb-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.kb-tool-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  gap: 0;
  flex: 0 0 auto;
}

.kb-tool-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.kb-tool-btn.is-active {
  color: #e8b86d;
  border-color: rgba(232, 184, 109, 0.55);
  background: rgba(232, 184, 109, 0.12);
}

.kb-tool-btn.is-active .kb-tool-icon path {
  fill: currentColor;
}

.kb-tool-btn.is-copied {
  /* Цвет кнопки «Поделиться» не меняем — подтверждение через тост */
  color: inherit;
}

.app-copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 12000;
  padding: 12px 18px;
  border-radius: 12px;
  background: #2f6fed;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

html[data-theme="light"] .app-copy-toast {
  color: #0a0a0c;
  box-shadow: 0 10px 28px rgba(40, 60, 120, 0.22);
}

.kb-tool-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.kb-feedback {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kb-feedback.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.kb-feedback-title {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.kb-feedback-thanks {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  animation: kb-feedback-thanks-in 0.35s ease;
}

@keyframes kb-feedback-thanks-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kb-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.kb-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #16161a;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.kb-feedback-btn:hover {
  background: #f7f7f8;
}

.kb-feedback-btn.is-active {
  /* Не подсвечивать прошлый выбор — при каждом открытии оба варианта равнозначны */
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.kb-feedback-emoji {
  font-size: 18px;
  line-height: 1;
  filter: grayscale(0) saturate(1.35) brightness(1.05);
}

.kb-actions {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.kb-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.kb-actions-row .auth-submit {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.kb-actions .auth-submit {
  width: 100%;
}

.kb-actions-row .auth-submit {
  width: auto;
}

.article-preview-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.article-preview-download-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.article-preview-download-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

html[data-theme="light"] .article-preview-download-btn {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.05);
  color: rgba(17, 24, 39, 0.9);
}

html[data-theme="light"] .article-preview-download-btn:hover {
  background: rgba(17, 24, 39, 0.1);
}

.kb-snippet {
  padding: 32px 28px 24px;
  max-width: 520px;
  margin: 0 auto;
}

.kb-snippet-from {
  margin: 0 0 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.kb-toc {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.kb-toc-list {
  flex: 1 1 auto;
}

.kb-suggest-btn {
  appearance: none;
  margin-top: auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

.kb-suggest-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Desktop: suggest stays in TOC; footer copy is for mobile only */
.kb-suggest-btn-footer {
  display: none;
}

body.info-modal-open {
  overflow: hidden;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Tag feed opens from an open article — must sit above .kb-modal (220). */
.tag-feed-modal {
  z-index: 260;
}

.info-modal[hidden] {
  display: none !important;
}

.info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

/* Mobile-only chrome; shown in styles.mobile.css */
.mobile-modal-footer {
  display: none;
}

.article-scroll-top-btn {
  display: none;
}

.info-modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  min-height: 220px;
  border-radius: 18px;
  padding: 22px 22px 24px;
}

.info-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.info-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.info-modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.info-modal-close:hover {
  color: var(--text);
}

.info-modal-body {
  min-height: 120px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.info-modal-body.info-modal-rich {
  white-space: normal;
  overflow: auto;
  max-height: min(62vh, 560px);
}

.info-modal-body.info-modal-rich p,
.info-modal-body.info-modal-rich ul,
.info-modal-body.info-modal-rich ol {
  margin: 0 0 0.75rem;
}

.info-modal-body.info-modal-rich p:last-child,
.info-modal-body.info-modal-rich ul:last-child,
.info-modal-body.info-modal-rich ol:last-child {
  margin-bottom: 0;
}

.info-modal-body.info-modal-rich img,
.info-modal-body.info-modal-rich video,
.info-modal-body .popup-rich-media {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem 0;
  border-radius: 10px;
}

.info-modal-body.info-modal-rich video {
  width: 100%;
  max-height: 360px;
  background: #000;
}

.info-modal-body.info-modal-rich table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 14px;
}

.info-modal-body.info-modal-rich th,
.info-modal-body.info-modal-rich td {
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 10px;
  vertical-align: top;
}

.info-modal-body.info-modal-rich th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

html[data-theme="light"] .info-modal-body.info-modal-rich th,
html[data-theme="light"] .info-modal-body.info-modal-rich td {
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .info-modal-body.info-modal-rich th {
  background: rgba(0, 0, 0, 0.04);
}

.favorites-menu-panel {
  width: min(560px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.favorites-menu-head {
  flex: 0 0 auto;
}

.favorites-menu-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 22px 22px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.favorites-menu-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.favorites-menu-empty {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.favorites-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.favorites-menu-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.favorites-menu-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.favorites-menu-main {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.favorites-menu-num {
  flex: 0 0 auto;
  min-width: 1.25em;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.favorites-menu-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.favorites-menu-item-title {
  font-size: 15px;
  font-weight: 560;
  line-height: 1.35;
}

.favorites-menu-item-desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-soft);
}

.favorites-menu-open {
  appearance: none;
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--glass-border);
  border-radius: 0;
  background: #ffffff;
  color: #141418;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.favorites-menu-open:hover {
  opacity: 0.92;
}

html[data-theme="light"] .favorites-menu-row {
  background: rgba(20, 20, 24, 0.03);
}

html[data-theme="light"] .favorites-menu-row:hover {
  background: rgba(20, 20, 24, 0.06);
  border-color: rgba(20, 20, 24, 0.16);
}

html[data-theme="light"] .favorites-menu-open {
  background: #141418;
  color: #ffffff;
  border-left-color: rgba(20, 20, 24, 0.14);
}

.sections-menu-panel {
  width: min(1180px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.sections-menu-head {
  flex: 0 0 auto;
}

.sections-menu-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  white-space: normal;
}

.sections-menu-layout {
  display: flex;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.sections-menu-nav {
  flex: 0 0 220px;
  width: 220px;
  max-width: 28%;
  overflow: auto;
  padding: 14px 12px 18px;
  border-right: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  background: rgba(0, 0, 0, 0.18);
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sections-menu-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.sections-menu-toc {
  flex: 0 0 220px;
  width: 220px;
  max-width: 26%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 12px 18px;
  border-right: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  background: rgba(0, 0, 0, 0.12);
}

.sections-menu-toc-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sections-menu-toc .kb-toc-title {
  margin: 0 4px 12px;
  flex: 0 0 auto;
}

.sections-menu-toc .kb-toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sections-menu-toc .kb-toc-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.sections-menu-toc .kb-suggest-btn {
  margin-top: 14px;
  width: 100%;
  flex: 0 0 auto;
}

.sections-menu-toc .kb-suggest-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sections-menu-close-link {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  margin: 0 0 10px;
  border-radius: 10px;
  cursor: pointer;
}

.sections-menu-close-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sections-menu-sec {
  margin: 12px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(125, 183, 255, 0.92);
}

.sections-menu-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: 10px;
}

.sections-menu-row.is-active {
  background: rgba(70, 130, 220, 0.35);
}

.sections-menu-link {
  appearance: none;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  padding: 8px 10px 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sections-menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sections-menu-row.is-active .sections-menu-link,
.sections-menu-link.is-active {
  background: transparent;
  color: #fff;
}

.sections-menu-order {
  display: inline-flex;
  flex-direction: row;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 0 0 8px;
  position: relative;
  z-index: 2;
}

.sections-menu-order-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  flex: 0 0 auto;
}

.sections-menu-order-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.sections-menu-order-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

html[data-theme="light"] .sections-menu-row.is-active {
  background: rgba(47, 111, 237, 0.16);
}

html[data-theme="light"] .sections-menu-order-btn {
  background: rgba(20, 20, 24, 0.08);
  border-color: rgba(20, 20, 24, 0.18);
  color: #16161a;
}

/* Mobile-only drag handle between article list and article body */
.sections-menu-splitter {
  display: none;
}

/* Mobile coachmark for sections splitter — shown only in styles.mobile.css */
.sections-splitter-hint {
  display: none;
}

.sections-menu-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  padding: 22px 24px 24px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sections-menu-content::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.sections-menu-article-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.sections-menu-article-view > .kb-article-head .sections-menu-article-title {
  margin: 0;
}

.sections-menu-empty {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.sections-menu-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  width: 100%;
  padding: 32px 28px;
  box-sizing: border-box;
  text-align: center;
}

.sections-menu-welcome-text {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.sections-menu-welcome-mobile {
  display: none;
}

html[data-theme="light"] .sections-menu-nav,
html[data-theme="light"] .sections-menu-toc {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .sections-menu-sec {
  color: #111827;
  font-weight: 700;
}

html[data-theme="light"] .sections-menu-link:hover,
html[data-theme="light"] .sections-menu-close-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .sections-menu-row.is-active .sections-menu-link,
html[data-theme="light"] .sections-menu-link.is-active {
  background: transparent;
  color: rgba(20, 40, 80, 0.95);
}

.info-modal-body.is-empty:empty::before {
  content: "";
}

.explore-links .is-popup-hidden,
[data-info-open].is-popup-hidden {
  display: none !important;
}

.suggest-modal {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.suggest-modal[hidden] {
  display: none !important;
}

.suggest-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.suggest-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border-radius: 18px;
  padding: 24px 22px 20px;
}

.suggest-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.suggest-lead {
  margin: 0 0 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
}

.suggest-panel > .suggest-title,
.suggest-panel > .suggest-lead {
  text-align: center;
}

.suggest-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  resize: vertical;
  min-height: 120px;
}

.suggest-form textarea:focus {
  border-color: rgba(255, 255, 255, 0.32);
}

.admin-subhead {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 600;
}

/* Theme switch (base look; position/z-index set above for overlay) */
.theme-switch {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.theme-switch-track {
  position: relative;
  width: 96px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--switch-track-border);
  background: var(--switch-track);
  color: var(--switch-track-text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition:
    background-color 1.6s ease,
    border-color 1.6s ease,
    color 1.4s ease,
    box-shadow 1.6s ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--switch-thumb);
  color: var(--switch-icon);
  box-shadow: var(--switch-thumb-shadow);
  transform: translateX(66px);
  transition:
    transform 1.6s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 1.6s ease,
    box-shadow 1.6s ease,
    color 1.4s ease;
}

.theme-icon {
  width: 14px;
  height: 14px;
  grid-area: 1 / 1;
}

.theme-icon-sun {
  opacity: 0;
  transform: scale(0.7) rotate(-30deg);
  transition: opacity 1.1s ease, transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  transition: opacity 1.1s ease, transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switch-text {
  position: absolute;
  top: 50%;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
  transform: translateY(-50%);
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.theme-switch-text-dark {
  left: 8px;
  opacity: 1;
}

.theme-switch-text-light {
  right: 8px;
  opacity: 0;
}

.theme-switch.is-light .theme-switch-thumb,
html[data-theme="light"] .theme-switch .theme-switch-thumb {
  transform: translateX(0);
}

.theme-switch.is-light .theme-switch-text-dark,
html[data-theme="light"] .theme-switch .theme-switch-text-dark {
  opacity: 0;
}

.theme-switch.is-light .theme-switch-text-light,
html[data-theme="light"] .theme-switch .theme-switch-text-light {
  opacity: 1;
}

.theme-switch.is-light .theme-icon-sun,
html[data-theme="light"] .theme-switch .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-switch.is-light .theme-icon-moon,
html[data-theme="light"] .theme-switch .theme-icon-moon {
  opacity: 0;
  transform: scale(0.7) rotate(30deg);
}

html[data-theme="light"] .auth-register-notice {
  border-color: rgba(180, 83, 9, 0.45);
  background: rgba(251, 191, 36, 0.16);
  color: #92400e;
}

html[data-theme="light"] .auth-password-toggle {
  color: rgba(28, 28, 31, 0.62);
}

html[data-theme="light"] .auth-password-toggle:hover {
  color: #1c1c1f;
  background: rgba(28, 28, 31, 0.06);
}

html[data-theme="light"] .auth-submit {
  color: #fff;
  background: #1c1c1f;
}

html[data-theme="light"] .auth-submit:hover {
  background: #2a2a2e;
}

html[data-theme="light"] .auth-submit-preview {
  background: #2f6fed;
  color: #fff;
  border-color: #2f6fed;
}

html[data-theme="light"] .auth-submit-preview:hover {
  background: #2560d6;
  border-color: #2560d6;
}

html[data-theme="light"] .auth-submit-secondary {
  color: var(--text);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
}

html[data-theme="light"] .auth-submit-secondary:hover {
  background: rgba(20, 20, 24, 0.1);
}

html[data-theme="light"] .auth-field input,
html[data-theme="light"] .article-form textarea,
html[data-theme="light"] .article-form select,
html[data-theme="light"] .article-form input[type="text"],
html[data-theme="light"] .auth-field select,
html[data-theme="light"] .articles-filters select,
html[data-theme="light"] .suggest-form textarea {
  background: var(--field-bg);
  border-color: var(--field-border);
  color: var(--text);
}

html[data-theme="light"] .auth-field select,
html[data-theme="light"] .articles-filters select,
html[data-theme="light"] .article-form select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(22, 22, 26, 0.65) 50%),
    linear-gradient(135deg, rgba(22, 22, 26, 0.65) 50%, transparent 50%),
    linear-gradient(to right, var(--field-bg), var(--field-bg));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

html[data-theme="light"] .auth-field select option,
html[data-theme="light"] .articles-filters select option,
html[data-theme="light"] .article-form select option {
  background: var(--option-bg);
  color: var(--text);
}

html[data-theme="light"] .auth-label,
html[data-theme="light"] .profile-user,
html[data-theme="light"] .kb-lead,
html[data-theme="light"] .kb-snippet-from,
html[data-theme="light"] .suggest-lead,
html[data-theme="light"] .shots-hint,
html[data-theme="light"] .shots-empty,
html[data-theme="light"] .admin-muted {
  color: var(--text-muted);
}

html[data-theme="light"] .profile-card h1,
html[data-theme="light"] .kb-main h1,
html[data-theme="light"] .kb-snippet h1,
html[data-theme="light"] .suggest-title,
html[data-theme="light"] .admin-subhead,
html[data-theme="light"] .auth-brand h2 {
  color: var(--text);
}

html[data-theme="light"] .profile-tab,
html[data-theme="light"] .admin-action {
  color: var(--text);
  background: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
}

html[data-theme="light"] .profile-tab.is-active,
html[data-theme="light"] .admin-action:hover {
  background: rgba(20, 20, 24, 0.1);
}

html[data-theme="light"] .admin-table th,
html[data-theme="light"] .admin-table td {
  border-color: var(--table-line);
  color: var(--text);
}

html[data-theme="light"] .admin-table th {
  color: var(--text-muted);
}

html[data-theme="light"] .kb-chip,
html[data-theme="light"] .shot-card {
  background: var(--chip-bg);
  border-color: var(--field-border);
  color: var(--text);
}

html[data-theme="light"] .kb-toc-item.is-active {
  background: rgba(17, 24, 39, 0.1);
  border-color: transparent;
  color: #111827;
  box-shadow: inset 3px 0 0 rgba(17, 24, 39, 0.75);
}

html[data-theme="light"] .kb-section p,
html[data-theme="light"] .kb-section-rich,
html[data-theme="light"] .kb-toc-item,
html[data-theme="light"] .shot-card-meta {
  color: var(--text-soft);
}

html[data-theme="light"] .kb-toc-title {
  color: #111827;
  font-weight: 700;
}

html[data-theme="light"] .kb-toc-num,
html[data-theme="light"] .kb-toc-item.is-active .kb-toc-num {
  color: #111827;
}

html[data-theme="light"] .kb-toc {
  background: rgba(255, 255, 255, 0.35);
  border-color: var(--glass-border);
}

html[data-theme="light"] .kb-suggest-btn {
  color: #111827;
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .kb-suggest-btn:hover {
  color: #111827;
  background: rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .kb-tool-btn[data-article-favorite].is-active {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.55);
  color: #16a34a;
}

html[data-theme="light"] .kb-tool-btn[data-article-favorite].is-active .kb-tool-icon,
html[data-theme="light"] .kb-tool-btn[data-article-favorite].is-active .kb-tool-icon path {
  fill: #16a34a;
  stroke: #16a34a;
}

html[data-theme="light"] .kb-tool-btn[data-article-share],
html[data-theme="light"] .kb-tool-btn[data-article-share]:hover,
html[data-theme="light"] .kb-tool-btn[data-article-share].is-copied {
  color: inherit;
}

html[data-theme="light"] .kb-feedback-btn {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  box-shadow: none;
}

html[data-theme="light"] .kb-feedback-btn:hover {
  background: #0b1220;
  color: #ffffff;
}

html[data-theme="light"] .kb-feedback-btn.is-active {
  outline: none;
  box-shadow: none;
}

html[data-theme="light"] .kb-backdrop,
html[data-theme="light"] .suggest-backdrop,
html[data-theme="light"] .auth-backdrop {
  background: rgba(40, 36, 30, 0.35);
}

html[data-theme="light"] .auth-field-error {
  color: #b42318;
}

html[data-theme="light"] .brand-mark {
  box-shadow: 0 0 0 1px rgba(20, 20, 24, 0.12);
}

.favorites-list {
  margin-top: 8px;
}

.favorites-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.favorites-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-decoration: none;
}

.favorites-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.favorites-title {
  font-weight: 600;
  color: var(--text);
}

.favorites-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.edits-list {
  margin-top: 8px;
}

.edits-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edits-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-decoration: none;
}

.edits-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.edits-title {
  font-weight: 600;
  color: var(--text);
}

.edits-message {
  font-size: 14px;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.edits-date {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-empty,
.profile-panel p.profile-empty {
  margin: 0;
  color: var(--text-muted);
}

html[data-theme="light"] .profile-empty,
html[data-theme="light"] .profile-panel p.profile-empty {
  color: rgba(22, 22, 26, 0.55);
}

html[data-theme="light"] .kb-tool-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .kb-feedback {
  border-top-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .favorites-link {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .edits-link {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .kb-actions {
  border-top-color: var(--table-line);
}

html[data-theme="light"] .article-form-footer {
  border-top-color: var(--table-line);
  background: rgba(246, 246, 248, 0.94);
}


.profile-support-actions {
  margin: 0 0 14px;
}

.support-ticket-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-ticket-card,
.support-ticket-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.support-ticket-subject {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.support-ticket-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
  white-space: pre-wrap;
}

.support-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.support-attach-media {
  max-width: 160px;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  object-fit: cover;
}

.support-ticket-panel {
  width: min(520px, 100%);
}

.support-ticket-body-field {
  margin-top: 10px;
}

.support-attach-fields {
  display: grid;
  gap: 10px;
}

.support-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.support-file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  overflow: hidden;
}

.support-file-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.support-file-name {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(240px, 100%);
}

.support-attach-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.support-attach-previews:empty {
  display: none;
}

.support-attach-preview {
  position: relative;
  width: 112px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.support-attach-preview img,
.support-attach-preview video {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
  background: #111;
}

.support-attach-preview-meta {
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-attach-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.support-attach-preview-remove:hover {
  background: rgba(0, 0, 0, 0.88);
}

body.misha-open {
  overflow: hidden;
}

.misha-modal {
  position: fixed;
  inset: 0;
  z-index: 28000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.misha-modal[hidden] {
  display: none !important;
}

.misha-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.misha-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(82vh, 820px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-sizing: border-box;
}

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

.misha-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.misha-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

html[data-theme="light"] .misha-avatar {
  background: rgba(20, 20, 24, 0.05);
  border-color: rgba(20, 20, 24, 0.1);
}

.misha-bear {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
}

.misha-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.misha-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.misha-log {
  flex: 1 1 auto;
  min-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .misha-log {
  background: rgba(255, 255, 255, 0.55);
}

.misha-msg {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.misha-msg-user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme="light"] .misha-msg-user {
  background: rgba(20, 20, 24, 0.08);
}

.misha-msg-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .misha-msg-assistant {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 20, 24, 0.1);
}

.misha-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.misha-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  object-fit: cover;
  flex: 0 0 auto;
}

.misha-thinking {
  align-self: flex-start;
  max-width: 100%;
  background: transparent;
  border: 0;
  padding: 6px 4px;
}

.misha-thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.misha-thinking-bear-wrap {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .misha-thinking-bear-wrap {
  background: rgba(20, 20, 24, 0.05);
  border-color: rgba(20, 20, 24, 0.1);
}

.misha-thinking-bear {
  width: 72px;
  height: 72px;
  display: block;
  object-fit: cover;
  border-radius: 14px;
}

.misha-thinking-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 72px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.misha-thinking-word {
  line-height: 1;
}

.misha-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 1.5em;
  line-height: 1;
}

.misha-dot {
  display: inline-block;
  width: 0.35em;
  text-align: center;
  opacity: 0.2;
  animation: misha-dot-pulse 1.2s linear infinite;
}

.misha-dot:nth-child(1) {
  animation-delay: 0s;
}

.misha-dot:nth-child(2) {
  animation-delay: 0.4s;
}

.misha-dot:nth-child(3) {
  animation-delay: 0.8s;
}

@keyframes misha-dot-pulse {
  0%,
  20% {
    opacity: 0.2;
  }
  35%,
  55% {
    opacity: 1;
  }
  70%,
  100% {
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .misha-dot {
    animation: none;
    opacity: 1;
  }
}

.misha-sources {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 420px);
}

.misha-sources-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.misha-source-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.misha-source-link:hover {
  background: var(--glass-bg-strong);
}

.misha-source-text {
  flex: 1 1 auto;
  min-width: 0;
}

.misha-source-title {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.misha-source-desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.35;
}

.misha-source-go {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 650;
  color: #5b8cff;
  white-space: nowrap;
}

html[data-theme="light"] .misha-source-go {
  color: #2f6fed;
}

.misha-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: flex-end;
}

.misha-form input,
.misha-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  min-height: 44px;
  max-height: calc(1.4em * 10 + 24px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  field-sizing: content;
}

html[data-theme="light"] .misha-form input,
html[data-theme="light"] .misha-form textarea {
  background: rgba(255, 255, 255, 0.75);
}

.misha-form .auth-submit {
  flex: 0 0 auto;
  min-width: 120px;
  align-self: flex-end;
  min-height: 44px;
}

.support-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  background: transparent;
  pointer-events: none;
}

.support-chat-modal[hidden] {
  display: none !important;
}

.support-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.support-chat-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100vw);
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  border-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.35);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.support-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.support-chat-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.support-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.support-chat-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
}

html[data-theme="light"] .support-chat-avatar {
  background: rgba(20, 20, 24, 0.05);
  border-color: rgba(20, 20, 24, 0.1);
}

.support-chat-title,
.support-chat-head .suggest-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.support-chat-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.support-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #3dd68c;
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.18);
}

html[data-theme="light"] .support-chat-status-dot {
  background: #0b7a45;
  box-shadow: 0 0 0 3px rgba(11, 122, 69, 0.16);
}

.support-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.support-chat-footer {
  flex: 0 0 auto;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-touch-callout: none;
  user-select: text;
}

.support-chat-msg.is-user {
  align-self: flex-end;
  background: rgba(47, 111, 237, 0.28);
}

.support-chat-msg.is-admin,
.support-chat-msg.is-system {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
}

.support-chat-msg-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}

.support-chat-msg-body {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.support-chat-msg.is-selected {
  outline: 2px solid rgba(250, 250, 250, 0.85);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.support-chat-msg-ref {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.18);
}

.support-chat-msg-ref-author {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 2px;
}

.support-chat-msg-ref-text {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.support-msg-menu {
  position: fixed;
  z-index: 40050;
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(22, 24, 30, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.support-msg-menu[hidden] {
  display: none !important;
}

.support-msg-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.support-msg-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.support-msg-menu-item.is-danger {
  color: #fecaca;
}

.support-msg-menu-item.is-danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

html[data-theme="light"] .support-msg-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16);
}

html[data-theme="light"] .support-msg-menu-item {
  color: rgba(17, 24, 39, 0.9);
}

html[data-theme="light"] .support-msg-menu-item:hover {
  background: rgba(17, 24, 39, 0.06);
}

html[data-theme="light"] .support-msg-menu-item.is-danger {
  color: #991b1b;
}

.support-chat-reply-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.support-chat-reply-bar[hidden] {
  display: none !important;
}

.support-chat-reply-info {
  min-width: 0;
  flex: 1 1 auto;
}

.support-chat-reply-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 2px;
}

.support-chat-reply-preview {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.support-chat-reply-cancel {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.support-chat-reply-cancel:hover {
  color: #fff;
}

html[data-theme="light"] .support-chat-msg.is-selected {
  outline-color: rgba(17, 24, 39, 0.75);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.18);
}

html[data-theme="light"] .support-chat-msg-ref {
  border-left-color: rgba(17, 24, 39, 0.35);
  background: rgba(17, 24, 39, 0.05);
}

html[data-theme="light"] .support-chat-msg-ref-author {
  color: rgba(17, 24, 39, 0.78);
}

html[data-theme="light"] .support-chat-msg-ref-text,
html[data-theme="light"] .support-chat-reply-preview {
  color: rgba(17, 24, 39, 0.6);
}

html[data-theme="light"] .support-chat-reply-bar {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .support-chat-reply-label {
  color: rgba(17, 24, 39, 0.78);
}

html[data-theme="light"] .support-chat-reply-cancel {
  color: rgba(17, 24, 39, 0.55);
}

html[data-theme="light"] .support-chat-reply-cancel:hover {
  color: rgba(17, 24, 39, 0.9);
}

.support-log-file {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.support-log-file:hover {
  background: rgba(255, 255, 255, 0.14);
}

.support-attach-list .support-log-file {
  margin-top: 0;
}

.support-chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.support-chat-form .support-chat-attach-btn {
  flex: 0 0 auto;
  align-self: flex-end;
}

.support-chat-form input,
.support-chat-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  min-height: 44px;
  max-height: calc(1.4em * 10 + 24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  field-sizing: content;
}

.support-chat-form .auth-submit {
  width: auto;
  flex: 0 0 auto;
  padding-inline: 16px;
  align-self: flex-end;
  min-height: 44px;
}

html[data-theme="light"] .support-chat-form textarea {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  border-color: rgba(0, 0, 0, 0.12);
}

.support-admin-body-cell {
  max-width: 280px;
  white-space: pre-wrap;
}

html[data-theme="light"] .support-ticket-card,
html[data-theme="light"] .support-ticket-row,
html[data-theme="light"] .support-chat-log,
html[data-theme="light"] .support-attach-media {
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .support-ticket-card,
html[data-theme="light"] .support-ticket-row {
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .support-ticket-body,
html[data-theme="light"] .support-chat-msg-meta {
  color: rgba(17, 24, 39, 0.62);
}

html[data-theme="light"] .support-chat-backdrop {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .support-chat-panel {
  border-left-color: rgba(20, 20, 24, 0.12);
  box-shadow: -18px 0 40px rgba(40, 30, 20, 0.18);
}

html[data-theme="light"] .support-log-file {
  border-color: rgba(20, 20, 24, 0.14);
  background: rgba(20, 20, 24, 0.06);
  color: #16161a;
}

html[data-theme="light"] .support-log-file:hover {
  background: rgba(20, 20, 24, 0.1);
}

html[data-theme="light"] .support-chat-head {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .support-chat-log {
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .support-chat-form input,
html[data-theme="light"] .support-chat-form textarea {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: #111;
}

.profile-devices-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-revoke-sessions-btn.admin-action {
  margin-top: 12px;
}

.profile-revoke-sessions-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.profile-device-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.profile-device-name {
  display: block;
  margin-bottom: 6px;
}

.profile-device-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

.support-logs-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}

.support-logs-switch-text {
  flex: 1;
  min-width: 0;
}

.support-switch {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  width: 44px;
  height: 26px;
}

.support-switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.support-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--switch-track-border);
  background: var(--switch-track);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.support-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--switch-thumb);
  box-shadow: var(--switch-thumb-shadow);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.support-switch-input:checked + .support-switch-track {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.28);
}

.support-switch-input:checked + .support-switch-track .support-switch-thumb {
  transform: translateX(18px);
}

.support-switch-input:focus-visible + .support-switch-track {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.support-widget-btn[hidden] {
  display: none !important;
}

.support-widget-btn-label {
  white-space: nowrap;
}

.support-chat-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.support-chat-attach-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.support-chat-attach-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.support-chat-attach-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-chat-msg-media {
  display: block;
  max-width: min(320px, 100%);
  max-height: 240px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  object-fit: cover;
  background: #111;
}

html[data-theme="light"] .support-chat-attach-btn {
  border-color: rgba(20, 20, 24, 0.14);
  background: rgba(20, 20, 24, 0.06);
  color: #16161a;
}

html[data-theme="light"] .support-chat-attach-btn:hover {
  background: rgba(20, 20, 24, 0.1);
}

html[data-theme="light"] .profile-device-card {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .profile-device-meta {
  color: rgba(17, 24, 39, 0.65);
}

html[data-theme="light"] .support-logs-switch {
  color: rgba(17, 24, 39, 0.78);
}

html[data-theme="light"] .support-file-name {
  color: rgba(17, 24, 39, 0.55);
}

html[data-theme="light"] .support-attach-preview {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(20, 20, 24, 0.12);
}

html[data-theme="light"] .support-attach-preview-meta {
  color: rgba(17, 24, 39, 0.55);
}

html[data-theme="light"] .support-attach-preview-remove {
  background: rgba(20, 20, 24, 0.72);
}

html[data-theme="light"] .support-switch-input:checked + .support-switch-track {
  background: rgba(20, 20, 24, 0.22);
  border-color: rgba(20, 20, 24, 0.28);
}

html[data-theme="light"] .support-switch-input:focus-visible + .support-switch-track {
  outline-color: rgba(20, 20, 24, 0.35);
}

.article-tags-field {
  position: relative;
  z-index: 20;
  overflow: visible;
}

.article-tags-wrap {
  position: relative;
  z-index: 21;
  overflow: visible;
}

.article-tags-dropdown {
  /* Glued to .article-tags-wrap — never fixed/viewport coords */
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 6px) !important;
  bottom: auto !important;
  width: auto !important;
  min-width: 0;
  max-width: none;
  z-index: 130;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(125, 183, 255, 0.35);
  background: #151a24;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  padding: 6px 0;
  transform: none !important;
}

.article-tags-dropdown.is-above {
  top: auto !important;
  bottom: calc(100% + 6px) !important;
}

.article-tags-dropdown[hidden] {
  display: none !important;
}

.article-tags-option {
  appearance: none;
  width: 100%;
  display: block;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: rgba(235, 242, 255, 0.95);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.article-tags-option:hover,
.article-tags-option.is-active {
  background: rgba(125, 183, 255, 0.22);
}

html[data-theme="light"] .article-tags-dropdown {
  background: #ffffff;
  border-color: rgba(47, 111, 237, 0.28);
  box-shadow: 0 14px 32px rgba(20, 24, 32, 0.18);
}

html[data-theme="light"] .article-tags-option {
  color: rgba(28, 32, 40, 0.92);
}

html[data-theme="light"] .article-tags-option:hover,
html[data-theme="light"] .article-tags-option.is-active {
  background: rgba(47, 111, 237, 0.12);
}

.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.kb-tag {
  appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125, 183, 255, 0.35);
  background: rgba(70, 130, 220, 0.18);
  color: rgba(210, 230, 255, 0.95);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  word-break: break-word;
  cursor: pointer;
  text-align: left;
}

.kb-tag:hover {
  border-color: rgba(125, 183, 255, 0.55);
  background: rgba(70, 130, 220, 0.28);
}

.kb-tag.is-active {
  border-color: rgba(125, 183, 255, 0.75);
  background: rgba(70, 130, 220, 0.42);
  box-shadow: 0 0 0 1px rgba(125, 183, 255, 0.25);
}

html[data-theme="light"] .kb-tag {
  border-color: rgba(47, 111, 237, 0.28);
  background: rgba(47, 111, 237, 0.1);
  color: #1d3f8f;
}

html[data-theme="light"] .kb-tag:hover {
  border-color: rgba(47, 111, 237, 0.45);
  background: rgba(47, 111, 237, 0.16);
}

html[data-theme="light"] .kb-tag.is-active {
  border-color: rgba(47, 111, 237, 0.55);
  background: rgba(47, 111, 237, 0.22);
}

.tag-feed-head-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.tag-feed-crumb {
  display: block;
}

.tag-feed-crumb-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(125, 183, 255, 0.45);
  border-radius: 999px;
  background: rgba(70, 130, 220, 0.22);
  padding: 6px 12px 6px 10px;
  margin: 0;
  color: rgba(190, 220, 255, 0.98);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 0 1px rgba(125, 183, 255, 0.12);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tag-feed-crumb-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.tag-feed-crumb-btn:hover {
  color: #fff;
  background: rgba(70, 130, 220, 0.34);
  border-color: rgba(125, 183, 255, 0.7);
  text-decoration: none;
}

html[data-theme="light"] .tag-feed-crumb-btn {
  color: #1d3f8f;
  background: rgba(47, 111, 237, 0.12);
  border-color: rgba(47, 111, 237, 0.35);
  box-shadow: none;
}

html[data-theme="light"] .tag-feed-crumb-btn:hover {
  color: #163275;
  background: rgba(47, 111, 237, 0.2);
  border-color: rgba(47, 111, 237, 0.5);
}

.tag-feed-active {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, rgba(255, 255, 255, 0.72));
}

.kb-tag-return-crumb {
  margin: 0 0 12px;
}

.kb-tag-return-crumb .tag-feed-crumb-btn {
  font-size: 14px;
}

.kb-version-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.kb-version-current,
.kb-version-history {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
}

.kb-version-current {
  text-align: left;
}

.kb-version-history {
  text-align: right;
}

/* Frame on the inactive control: history while viewing current; current while viewing history */
.kb-version-current:not(.is-active),
.kb-version-history:not(.is-active) {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.kb-version-current.is-active,
.kb-version-history.is-active {
  color: #fff;
  font-weight: 600;
}

.kb-version-current:hover,
.kb-version-history:hover {
  color: #fff;
}

.kb-version-history.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  font-weight: 400;
}

.kb-version-history.is-disabled:hover {
  color: rgba(255, 255, 255, 0.72);
}

.kb-version-hint {
  position: fixed;
  z-index: 40060;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 20, 26, 0.96);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.kb-version-hint[hidden] {
  display: none !important;
}

html[data-theme="light"] .kb-version-history.is-disabled:hover {
  color: rgba(17, 24, 39, 0.7);
}

html[data-theme="light"] .kb-version-hint {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 24, 39, 0.12);
  color: rgba(17, 24, 39, 0.9);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.14);
}

.kb-history-empty {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.6);
}

.kb-history-layout {
  margin-top: 4px;
}

.kb-history-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 34%);
  gap: 10px 14px;
  align-items: start;
}

.kb-history-text {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.5;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.04);
}

.kb-history-row-add .kb-history-text {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  box-shadow: inset 3px 0 0 #22c55e;
}

.kb-history-row-del .kb-history-text {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  text-decoration: none;
  box-shadow: inset 3px 0 0 #ef4444;
}

.kb-history-rail {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 8px;
}

.kb-history-line {
  flex: 0 0 auto;
  width: 18px;
  height: 2px;
  border-radius: 2px;
}

.kb-history-line-add {
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.kb-history-line-del {
  background: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.kb-history-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kb-history-date {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.kb-history-prev {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.changes-menu-panel {
  width: min(720px, calc(100vw - 24px));
  max-height: min(80vh, 760px);
}

.changes-menu-body {
  overflow: auto;
  padding: 8px 16px 18px;
  max-height: min(68vh, 640px);
}

.changes-menu-empty {
  margin: 12px 0;
  color: rgba(255, 255, 255, 0.62);
}

.changes-menu-section {
  margin: 0 0 18px;
}

.changes-menu-section:last-child {
  margin-bottom: 0;
}

.changes-menu-section-title {
  margin: 4px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(125, 183, 255, 0.95);
}

html[data-theme="light"] .changes-menu-section-title {
  color: rgba(17, 24, 39, 0.88);
}

.changes-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changes-menu-row {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.changes-menu-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
}

.changes-menu-main:hover {
  background: rgba(255, 255, 255, 0.05);
}

.changes-menu-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.changes-menu-title {
  font-weight: 600;
  font-size: 15px;
}

.changes-menu-date {
  flex: 0 0 auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.changes-menu-diff {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.changes-menu-add,
.changes-menu-del {
  font-size: 13px;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 8px;
}

.changes-menu-add {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.changes-menu-del {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  text-decoration: none;
}

html[data-theme="light"] .kb-version-current,
html[data-theme="light"] .kb-version-history {
  color: rgba(17, 24, 39, 0.7);
}

html[data-theme="light"] .kb-version-current:not(.is-active),
html[data-theme="light"] .kb-version-history:not(.is-active) {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .kb-version-current.is-active,
html[data-theme="light"] .kb-version-history.is-active,
html[data-theme="light"] .kb-version-current:hover,
html[data-theme="light"] .kb-version-history:hover {
  color: rgba(17, 24, 39, 0.95);
}

html[data-theme="light"] .kb-history-text {
  color: rgba(17, 24, 39, 0.88);
  background: rgba(17, 24, 39, 0.03);
}

html[data-theme="light"] .kb-history-row-add .kb-history-text {
  color: #111827;
  background: rgba(34, 197, 94, 0.12);
}

html[data-theme="light"] .kb-history-row-del .kb-history-text {
  color: #111827;
  background: rgba(239, 68, 68, 0.1);
}

html[data-theme="light"] .kb-history-date {
  color: rgba(17, 24, 39, 0.8);
}

html[data-theme="light"] .kb-history-prev,
html[data-theme="light"] .changes-menu-date,
html[data-theme="light"] .changes-menu-empty {
  color: rgba(17, 24, 39, 0.55);
}

html[data-theme="light"] .changes-menu-row {
  border-color: rgba(17, 24, 39, 0.1);
  background: rgba(17, 24, 39, 0.02);
}

html[data-theme="light"] .changes-menu-main:hover {
  background: rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .changes-menu-add {
  color: #111827;
  background: rgba(34, 197, 94, 0.12);
}

html[data-theme="light"] .changes-menu-del {
  color: #111827;
  background: rgba(239, 68, 68, 0.1);
}
