/* ========== ЯВНАЯ ФИКСАЦИЯ ДЛЯ RTL (ДОБАВЬТЕ В НАЧАЛО) ========== */

/* Отключаем RTL-зеркалирование для меню */
.menu-corner,
.menu-container {
    transform: none !important;
}

/* Явно фиксируем позицию для RTL языков */
[dir="rtl"] .menu-corner,
[dir="rtl"] .menu-container {
    right: 10px !important;
    left: auto !important;
    transform: none !important;
}

/* ========== ОРИГИНАЛЬНЫЕ СТИЛИ ========== */

.menu-corner {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px) + 8px);
  right: max(10px, env(safe-area-inset-right, 0px) + 8px);
  z-index: 10003; /* Sn всегда кликабелен поверх панели меню */
  display: flex;
  align-items: center;
  gap: 6px;
}

[dir="rtl"] .menu-corner {
  right: 10px !important;
  left: auto !important;
}

/* Общий хром угла: колокольчик и Sn — одна семья кнопок */
.menu-activity-bell,
.menu-button {
  --sn-ease: cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  border: 1px solid rgba(20, 24, 32, 0.1);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.88) 100%);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(20, 24, 32, 0.04),
    0 8px 20px rgba(20, 24, 32, 0.08);
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.28s var(--sn-ease),
    box-shadow 0.28s var(--sn-ease),
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.menu-activity-bell:hover,
.menu-button:hover {
  background:
    linear-gradient(180deg, #ffffff 0%, rgba(252, 253, 255, 0.95) 100%);
  border-color: rgba(217, 44, 44, 0.38);
  box-shadow:
    0 2px 4px rgba(20, 24, 32, 0.05),
    0 12px 28px rgba(20, 24, 32, 0.12),
    0 0 0 3px rgba(217, 44, 44, 0.1);
  transform: translateY(-1px);
}

.menu-activity-bell:active,
.menu-button:active {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 1px 2px rgba(20, 24, 32, 0.06),
    0 4px 12px rgba(20, 24, 32, 0.08);
}

.menu-activity-bell {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px) + 8px);
  right: calc(max(10px, env(safe-area-inset-right, 0px) + 8px) + 3rem + 8px);
  z-index: 9999; /* ниже открытого меню (10002), чтобы не перекрывать пункты */
  width: 44px;
  min-width: 44px;
  padding: 0;
  color: #3f4654;
}

[dir="rtl"] .menu-activity-bell {
  right: auto !important;
  left: calc(max(10px, env(safe-area-inset-left, 0px) + 8px) + 3rem + 8px);
}

.menu-activity-bell:hover {
  color: #d92c2c;
}

.menu-activity-bell__icon {
  display: block;
}

.menu-activity-bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d92c2c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: border-box;
  pointer-events: none;
}

.menu-activity-bell[hidden],
.menu-activity-bell__badge[hidden] {
  display: none !important;
}

/* Служебный низ: язык + тема слева, доступность справа — тот же фон, что у панели меню */
.menu-chrome {
  position: sticky;
  bottom: -1px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 6px -2px -2px;
  padding: 8px 2px 2px;
  border-top: 1px solid rgba(20, 24, 32, 0.08);
  background: transparent;
  backdrop-filter: none;
}

.menu-chrome__leading {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.menu-chrome__lang {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: min(11.5rem, calc(100% - 36px));
  padding: 2px 4px !important;
  margin: 0;
  border-radius: 6px;
  background: transparent;
}

.menu-chrome__lang:hover,
.menu-chrome__lang:focus-within {
  background-color: rgba(15, 23, 42, 0.04);
}

.menu-chrome__lang .tool-icon {
  width: 15px;
  height: 15px;
  margin: 0;
  flex-shrink: 0;
  opacity: 0.7;
}

.menu-chrome__lang .tool-icon svg {
  width: 15px;
  height: 15px;
}

.menu-chrome__lang .lang-selector {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 28px;
  line-height: 26px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  padding: 2px 18px 2px 6px;
  border-color: rgba(20, 24, 32, 0.12);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.72);
  color: #4b5563;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-theme-btn {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
}

.menu-theme-btn:not([hidden]) {
  display: inline-flex;
}

.menu-theme-btn:hover,
.menu-theme-btn:focus-visible {
  color: #4b5563;
  background: rgba(15, 23, 42, 0.05);
  outline: none;
}

.menu-theme-btn__icon {
  display: none;
  line-height: 0;
}

.menu-theme-btn__icon svg {
  display: block;
  width: 15px;
  height: 15px;
}

/* В светлой теме показываем луну (переключить на тёмную), в тёмной — солнце */
html[data-theme="light"] .menu-theme-btn__icon--moon,
html:not([data-theme]) .menu-theme-btn__icon--moon {
  display: block;
}
html[data-theme="dark"] .menu-theme-btn__icon--sun {
  display: block;
}

.menu-settings-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
}

.menu-settings-btn:hover,
.menu-settings-btn:focus-visible {
  color: #4b5563;
  background: rgba(15, 23, 42, 0.05);
  outline: none;
}

.menu-settings-btn[aria-expanded="true"] {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.menu-settings-btn .tool-icon {
  width: 15px;
  height: 15px;
  margin: 0;
  opacity: 0.85;
}

.menu-settings-btn .tool-icon svg {
  width: 15px;
  height: 15px;
}

[dir="rtl"] .menu-chrome {
  flex-direction: row-reverse;
}

.menu-settings-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  top: auto;
  z-index: 4;
  min-width: 0;
  max-width: none;
  background-color: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 8px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  max-height: min(55vh, 340px);
  overflow-y: auto;
}

.menu-settings-panel.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

[dir="rtl"] .menu-settings-panel {
  right: 0 !important;
  left: 0 !important;
}

.menu-button {
  position: relative;
  top: auto;
  right: auto;
  gap: 0;
  width: auto;
  min-width: 44px;
  padding: 0 12px;
  color: #141820;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  z-index: auto;
}

.menu-button:focus-visible {
  outline: none;
  border-color: rgba(217, 44, 44, 0.55);
  box-shadow:
    0 2px 4px rgba(20, 24, 32, 0.05),
    0 12px 28px rgba(20, 24, 32, 0.12),
    0 0 0 3px rgba(217, 44, 44, 0.22);
}

.menu-button:active,
.menu-button[aria-expanded="true"] {
  border-color: rgba(217, 44, 44, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 248, 247, 0.98) 0%, rgba(255, 242, 240, 0.94) 100%);
  box-shadow:
    0 1px 2px rgba(217, 44, 44, 0.08),
    0 8px 22px rgba(217, 44, 44, 0.14),
    0 0 0 3px rgba(217, 44, 44, 0.12);
  transform: translateY(0);
}

.menu-button-unread-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d92c2c;
    border: 2px solid #fff;
    pointer-events: none;
    box-sizing: content-box;
    box-shadow: 0 0 0 1px rgba(217, 44, 44, 0.2);
}

.menu-button span.s,
.menu-button span.n {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    display: inline-block;
    transition: transform 0.28s var(--sn-ease), color 0.2s ease;
}

.menu-button span.s {
    color: #d92c2c;
}

.menu-button span.n {
    color: #141820;
}

.menu-button:hover span.s {
  transform: translateY(-0.5px);
}

.menu-button[aria-expanded="true"] span.s {
  color: #c01f1f;
}

.menu-button[aria-expanded="true"] span.n {
  color: #1a1f28;
}

.menu-container {
    position: fixed;
    top: 50px;
    right: 10px;
    width: min(18.5rem, calc(100vw - 1.25rem));
    max-width: min(18.5rem, calc(100vw - 1.25rem));
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid rgba(20, 24, 32, 0.1);
    box-shadow:
      0 1px 2px rgba(20, 24, 32, 0.04),
      0 18px 40px rgba(20, 24, 32, 0.14);
    padding: 8px;
    z-index: 10000;
    border-radius: 14px;
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    visibility: hidden;
    transition:
      opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
    color: #141820;
    letter-spacing: -0.015em;
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(20, 24, 32, 0.22) transparent;
}

.menu-container::-webkit-scrollbar {
  width: 5px;
}
.menu-container::-webkit-scrollbar-track {
  background: transparent;
}
.menu-container::-webkit-scrollbar-thumb {
  background-color: rgba(20, 24, 32, 0.2);
  border-radius: 999px;
}

.menu-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    z-index: 10002; /* выше .menu-corner (колокольчик), ниже по геометрии кнопки Sn */
}

.menu-container a {
    display: block;
    padding: 0.65rem 0.75rem;
    color: #1a1f28;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 650;
    font-size: 0.92rem;
    line-height: 1.3;
    transition:
      background-color 0.18s ease,
      color 0.18s ease,
      transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-container a[hidden] {
    display: none !important;
}

.menu-container a:hover {
    background-color: rgba(217, 44, 44, 0.07);
    color: #141820;
}

.submenu-container {
    display: none;
    padding-left: 0.55rem;
    margin: 0.15rem 0 0.35rem;
    border-left: 1px solid rgba(20, 24, 32, 0.08);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.submenu-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.submenu-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    padding: 0.65rem 0.75rem 0.25rem;
    margin: 0.15rem 0 0;
    text-transform: none;
    letter-spacing: 0.02em;
    pointer-events: none;
    user-select: none;
}

.submenu-container a {
    font-size: 0.88rem;
    padding: 0.55rem 0.7rem;
    margin: 1px 0;
    border-radius: 8px;
    font-weight: 600;
}

.submenu-container a:hover {
    background-color: rgba(217, 44, 44, 0.08);
    color: #c01f1f;
    transform: none;
}

/* Serpmonn Android: APK row + quiet RuStore link */
.menu-android-app {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.menu-android-app__apk {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
}

.menu-android-app__rustore {
    flex: 0 0 auto;
    padding: 6px 8px !important;
    margin: 0 4px 0 0 !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    text-decoration: none !important;
    white-space: nowrap;
    transform: none !important;
    background: transparent !important;
}

.menu-android-app__rustore:hover {
    color: #0077ff !important;
    background: #f3f4f6 !important;
    transform: none !important;
}

@media (max-width: 420px) {
    .menu-android-app {
        flex-wrap: wrap;
        align-items: stretch;
    }
    .menu-android-app__rustore {
        margin: 0 0 4px 28px !important;
    }
}

.menu-item[data-submenu] {
    position: relative;
    font-weight: 650;
}

/* СТРЕЛОЧКИ ДЛЯ LTR (СПРАВА) */
.menu-item[data-submenu]:after {
    content: '›';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    font-weight: 500;
    color: #9aa3b2;
    transition: transform 0.2s ease, color 0.2s ease;
}

.menu-item[data-submenu][aria-expanded="true"]:after {
    transform: translateY(-50%) rotate(90deg);
    color: #d92c2c;
}

/* Стили для плейсхолдеров инструментов */
.tool-placeholder {
    opacity: 0.7;
    cursor: not-allowed;
}

.tool-placeholder:hover {
    background-color: #f5f5f5 !important;
    color: #999 !important;
}

/* Стили для плейсхолдеров игр */
.game-placeholder {
    opacity: 0.7;
    cursor: not-allowed;
    color: #999;
}

.game-placeholder:hover {
    background-color: #f5f5f5 !important;
    color: #999 !important;
}

/* Стили для иконок инструментов / KB */
.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 8px;
    width: 20px;
    height: 20px;
    text-align: center;
    flex-shrink: 0;
    vertical-align: middle;
    color: #d92c2c; /* активный бренд; иерархия — через stroke, не через серый */
}
.tool-icon--cat {
    color: #d92c2c;
}
.tool-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.tool-icon--cat svg {
    stroke-width: 2.15;
}
.tool-icon--item svg {
    stroke-width: 1.75;
}
.submenu-container a:hover .tool-icon {
    color: inherit;
}
/* «Скоро» / плейсхолдеры — серый только здесь */
.tool-placeholder .tool-icon,
.game-placeholder .tool-icon,
.app-placeholder .tool-icon {
    color: #9ca3af;
}
.menu-item > .tool-icon,
.lang-selector-item > .tool-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}
.menu-item > .tool-icon svg,
.lang-selector-item > .tool-icon svg {
    width: 20px;
    height: 20px;
}
.a11y-toggle .tool-icon {
    margin-right: 8px;
    color: #e53935;
}

/* Стили для иконок игр */
.game-icon {
    display: inline-block;
    font-size: 16px;
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* Стили для плейсхолдеров приложений */
.app-placeholder {
    opacity: 0.7;
    cursor: not-allowed;
    color: #999;
}

.app-placeholder:hover {
    background-color: #f5f5f5 !important;
    color: #999 !important;
}

/* Стили для иконок приложений */
.app-icon {
    display: inline-block;
    font-size: 16px;
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* Анимации для подменю */
.submenu-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu-container .icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.menu-logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
}

.menu-search-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
    border-radius: 50%;
}

.menu-search-container {
    padding: 5px;
    border-radius: 8px;
    margin: 0;
}

/* Адаптация поля поиска */
.menu-search-row .gcse-searchbox-only {
    flex-grow: 1;
    min-width: 0;
}

/* Скрыть устаревшие элементы выбора языка в меню, если остались */
[data-lang] { display: none !important; }
[data-submenu="langSubmenu"],
#langSubmenu { display: none !important; }

.menu-search-container .gcse-searchbox-only {
    width: 100%;
}

.gsc-search-button.gsc-search-button-v2 {
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
}

/* Жёстко держим кнопку справа и по центру относительно поля */
.menu-search-row .gsc-search-box,
.menu-search-row .gsc-search-box-tools {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
}

.menu-search-row .gsc-search-button.gsc-search-button-v2,
.menu-search-row button.gsc-search-button {
    display: inline-flex !important;
    align-items: center !important;
    height: 34px !important;
    line-height: 34px !important;
    margin: 0 !important;
    vertical-align: middle !important;
    align-self: center !important;
}

.menu-search-container input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.menu-search-container.hidden {
    display: none;
}

/* Бейджи для пунктов меню */
.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    color: #fff;
    background-color: #dc3545;
    border-radius: 9999px;
    vertical-align: middle;
}

/* Стили для кнопок доступности в меню */
.a11y-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px !important;
    text-decoration: none !important;
    color: inherit !important;
    border-radius: 6px;
    transition: background-color 0.2s;
    min-height: 44px;
}

.a11y-toggle:hover {
    background-color: rgba(255,255,255,0.1) !important;
}

.a11y-toggle:active {
    background-color: rgba(255,255,255,0.2) !important;
}

.a11y-icon {
    margin-right: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.a11y-status {
    width: 12px;
    height: 12px;
    margin-left: auto;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #9ca3af;
    background: #fff;
    box-sizing: border-box;
}
.a11y-status.is-on {
    border-color: #e53935;
    background: #e53935;
}
.a11y-status.is-off {
    border-color: #9ca3af;
    background: #fff;
}

/* Стили для логотипа в меню */
.menu-logo-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-logo-link:hover {
    transform: scale(1.1);
}

.menu-logo-link:active {
    transform: scale(0.95);
}

/* ========== RTL СТИЛИ (СТРЕЛОЧКИ СЛЕВА И ПОИСК) ========== */

/* СТРЕЛОЧКИ ДЛЯ RTL (СЛЕВА) */
[dir="rtl"] .menu-item[data-submenu]:after {
    content: '‹' !important;
    right: auto !important;
    left: 10px !important;
    transform: translateY(-50%) !important;
}

[dir="rtl"] .menu-item[data-submenu][aria-expanded="true"]:after {
    transform: translateY(-50%) rotate(-90deg) !important;
}

/* ПОИСКОВАЯ СТРОКА ДЛЯ RTL: Логотип (справа) → Поле поиска → Кнопка поиска (слева) */
[dir="rtl"] .menu-search-row {
    flex-direction: row !important; /* Отменяем row-reverse, оставляем нормальный порядок */
}

/* Для RTL меняем порядок через order: 3-2-1 (справа налево) */
[dir="rtl"] .menu-logo-link {
    order: 3 !important; /* Логотип справа (последний) */
}

[dir="rtl"] .menu-search-row .gcse-searchbox-only {
    order: 2 !important; /* Поле поиска в середине */
}

[dir="rtl"] .menu-search-row .gsc-search-button.gsc-search-button-v2,
[dir="rtl"] .menu-search-row button.gsc-search-button {
    order: 1 !important; /* Кнопка поиска слева (первая) */
    border-radius: 8px 0 0 8px !important; /* Скругление слева */
}

/* Внутренний контейнер Google Search для RTL - кнопка слева от поля */
[dir="rtl"] .gsc-search-box,
[dir="rtl"] .gsc-search-box-tools {
    flex-direction: row !important; /* Кнопка | Поле (нормальный порядок) */
}

/* Кнопка поиска Google для RTL */
[dir="rtl"] .gsc-search-button.gsc-search-button-v2 {
    border-radius: 8px 0 0 8px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Поле ввода Google для RTL */
[dir="rtl"] .gsc-input {
    border-radius: 0 8px 8px 0 !important;
    text-align: right !important;
    direction: rtl !important;
}

/* ИКОНКИ ДЛЯ RTL (СПРАВА ОТ ТЕКСТА) */
[dir="rtl"] .icon {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

[dir="rtl"] .tool-icon,
[dir="rtl"] .game-icon,
[dir="rtl"] .app-icon,
[dir="rtl"] .a11y-icon {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* ПОДМЕНЮ ДЛЯ RTL (ОТСТУП СПРАВА) */
[dir="rtl"] .submenu-container {
    padding-left: 0 !important;
    padding-right: 20px !important;
}

/* HOVER-ЭФФЕКТ ДЛЯ RTL — без сдвига, как в LTR */
[dir="rtl"] .submenu-container a:hover {
    transform: none !important;
}

/* СТРЕЛОЧКИ В ПОДМЕНЮ ДЛЯ RTL */
[dir="rtl"] .submenu-container .menu-item[data-submenu]:after {
    right: auto !important;
    left: 10px !important;
}

/* А11Y-СТАТУС ДЛЯ RTL */
[dir="rtl"] .a11y-status {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Ряд с двумя кнопками */
.auth-buttons {
  display: flex;          /* ставит VK и Serpmonn в строку */
  align-items: center;    /* выравнивает по вертикали */
  gap: 15px;              /* расстояние между ними */
  padding: 8px 10px;
}

/* Общий контейнер-иконка (кнопка) */
.auth-icon {
  display: inline-flex;   /* даёт центрирование содержимого */
  align-items: center;    /* по вертикали */
  justify-content: center;/* по горизонтали */
  width: 48px;
  height: 48px;
  border-radius: 50%;     /* делает круг */
  background: #fff;       /* белый фон, */
}

/* Серпмонн-кнопка: картинка заполняет кнопку без искажений */
.serpmonn-btn {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

/* Контейнер Serpmonn — белый фон, как у VK */
.auth-serpmonn {
  background: #fff;
}

.mini-shell-root,
.mini-shell-layout {
  width: 100%;
  height: 100%;
}

.mini-shell-layout {
  display: flex;
  flex-direction: column;
}

.mini-menu-container {
  /* если меню сверху фиксированное */
}

.mini-frame {
  width: 100%;
  border: 0;
  flex: 1 1 auto;
}

/* Затемнение всего экрана */
.spn-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
}

/* «Дырка» над кнопкой меню через огромный box-shadow */
.spn-menu-overlay__hole {
  position: absolute;
  border-radius: 999px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Контейнер подсказки */
.spn-menu-overlay__hint {
  position: absolute;
  max-width: 260px;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
}

/* Линия-стрелка, которая тянется к кнопке меню */
.spn-menu-overlay__arrow {
  position: absolute;
  width: 80px;          /* длина стрелки, можно подстроить */
  height: 2px;
  background: #fff;
  transform-origin: left center;
}

/* Наконечник стрелки */
.spn-menu-overlay__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-left: 8px solid #fff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

@media (max-width: 480px) {
  .spn-menu-overlay__hint {
    max-width: 200px;
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .menu-corner {
    top: max(14px, env(safe-area-inset-top, 0px) + 10px);
    right: max(10px, env(safe-area-inset-right, 0px) + 6px);
    gap: 5px;
  }

  .menu-activity-bell {
    top: max(14px, env(safe-area-inset-top, 0px) + 10px);
    right: calc(max(10px, env(safe-area-inset-right, 0px) + 6px) + 44px + 8px);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
  }

  [dir="rtl"] .menu-activity-bell {
    right: auto !important;
    left: calc(max(10px, env(safe-area-inset-left, 0px) + 6px) + 44px + 8px);
  }

  .menu-chrome__lang {
    max-width: min(9rem, calc(100% - 40px));
  }

  .menu-button {
    top: auto;
    right: auto;
    width: auto;
    min-width: 44px;
    max-width: min(70vw, 10.5rem);
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
  }

  .menu-button[aria-expanded="true"] {
    padding: 0 12px;
  }
}

@media (max-width: 600px) {
    .menu-container {
        width: min(85%, 18rem);
        max-width: min(85%, 18rem);
        max-height: 80vh;
        overflow-y: auto;
        overflow-x: hidden;
        top: 10px;
        right: 5px;
        padding: 8px;
        border-radius: 14px;
        scrollbar-width: thin;
        scrollbar-color: rgba(20, 24, 32, 0.25) transparent;
    }

    .menu-container::-webkit-scrollbar {
        width: 4px;
    }

    .menu-container::-webkit-scrollbar-track {
        background: transparent;
    }

    .menu-container::-webkit-scrollbar-thumb {
        background-color: rgba(20, 24, 32, 0.25);
        border-radius: 2px;
    }

    .menu-container::-webkit-scrollbar-thumb:hover {
        background-color: rgba(20, 24, 32, 0.4);
    }

    .menu-container a {
        padding: 0.6rem 0.7rem;
        font-size: 0.9rem;
    }

    .submenu-container {
        padding-left: 0.45rem;
    }

    .submenu-container a {
        font-size: 0.8rem;
        padding: 5px 8px;
        font-weight: bold;
    }

    .menu-container .icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }

    .menu-search-row .gsc-search-button.gsc-search-button-v2,
    .menu-search-row button.gsc-search-button {
        min-height: 41px;
        height: 41px !important;
        padding: 0px 12px;
        border-radius: 0 8px 8px 0;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .menu-container {
        max-width: min(90%, 17rem);
        max-height: 75vh;
        padding: 6px;
    }

    .menu-container a {
        padding: 6px;
        font-size: 0.85rem;
    }

    .submenu-container {
        padding-left: 10px;
    }

    .submenu-container a {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    .menu-container .icon {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }

    .menu-search-row .gsc-search-button.gsc-search-button-v2,
    .menu-search-row button.gsc-search-button {
        min-height: 41px;
        height: 41px !important;
        padding: 0px 12px;
        border-radius: 0 8px 8px 0;
    }
}

/* Мобильные стили для кнопок доступности */
@media (max-width: 768px) {
    .a11y-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 12px 16px !important;
    }

    .a11y-icon {
        font-size: 18px;
    }

    .a11y-status {
        font-size: 16px;
    }
}

/* Мобильные стили для логотипа */
@media (max-width: 768px) {
    .menu-logo-link {
        min-width: 48px;
        min-height: 48px;
    }
}

/* МОБИЛЬНАЯ ВЕРСИЯ ДЛЯ RTL */
@media (max-width: 600px) {
    [dir="rtl"] .menu-search-row .gsc-search-button.gsc-search-button-v2,
    [dir="rtl"] .menu-search-row button.gsc-search-button {
        border-radius: 8px 0 0 8px !important;
    }
    
    [dir="rtl"] .submenu-container {
        padding-left: 0 !important;
        padding-right: 12px !important;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .submenu-container {
        padding-left: 0 !important;
        padding-right: 10px !important;
    }
    
    [dir="rtl"] .icon {
        margin-right: 0 !important;
        margin-left: 6px !important;
    }
}
/* ===== Findings / activity modals (needed on standalone pages via menu.html) ===== */
/* ====== Модалка "Поделиться ответом" ====== */

.ai-share-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;                 /* управляется JS */
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
  text-align: left;
  line-height: 1.4;
  box-sizing: border-box;
}

.ai-share-modal *,
.ai-share-modal *::before,
.ai-share-modal *::after {
  box-sizing: border-box;
}

.ai-share-modal p {
  text-align: left;
  margin-bottom: 0;
}

.ai-share-modal .ai-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35); /* лёгкий тёмный фон */
}

/* Карточка модалки — как ai-result-container, но поменьше и по центру */
.ai-share-dialog {
  max-width: 380px;
  background: rgba(255,255,255,0.96);
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 24px 60px rgba(15,23,42,0.35);
  padding: 14px 14px 10px;
  transform: scale(0.96) translateY(4px);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ai-share-modal[data-open="true"] .ai-share-dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.ai-share-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #0f172a;
}

/* Кнопка закрытия в правом верхнем углу */
.ai-share-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}

.ai-share-close:hover {
  color: #111827;
}

/* Варианты шаринга: вертикальный стек, как список действий */
.ai-share-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* Кнопки опций — по стилю близки к .ai-action-btn, но вытянутые */
.ai-share-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(220, 53, 69, 0.35);  /* красный бордер, как у .ai-action-btn */
  background: linear-gradient(145deg, #111111, #1a1a1a);
  color: #f9fafb;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease,
              box-shadow 0.2s ease, border-color 0.2s ease;
}

/* hover/active — повторяем поведение круглых кнопок */
.ai-share-option:hover {
  background: linear-gradient(145deg, #1a1a1a, #222222);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.ai-share-option:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Немного отличий для соцсетей, но в том же диапазоне */
.ai-share-telegram {
  border-color: rgba(56, 189, 248, 0.7);
}

.ai-share-vk {
  border-color: rgba(59, 130, 246, 0.7);
}

/* ====== Тост "скопировано" ====== */

.ai-share-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 24, 39, 0.96);           /* тёмный, как фон action-кнопок */
  color: #f9fafb;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(220, 53, 69, 0.45);    /* красный акцент */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 1400;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ai-share-toast.visible,
.ai-share-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ai-share-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

/* Кнопка = прозрачный квадрат под круглый логотип */
.ai-share-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  box-shadow: none;
}

/* убиваем любые старые псевдо-иконки */
.ai-share-pill::before {
  content: none !important;
}

/* сам официальный логотип */
.ai-share-pill svg {
  display: block;
}

.ai-share-pill:hover {
  transform: translateY(-1px) scale(1.05);
}

.ai-share-pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-share-pill-icon--vk {
  background: #0077ff;
  color: #fff;
}

.ai-share-pill-icon--max {
  background: linear-gradient(135deg, #44ccff 0%, #5533ee 62%, #9933dd 100%);
  color: #fff;
}

.ai-share-pill-icon--ok {
  background: #ee8208;
  color: #fff;
}

.ai-share-copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.ai-share-url-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.ai-share-copy-btn {
  flex: 1;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(220, 53, 69, 0.35);
  background: linear-gradient(145deg, #111111, #1a1a1a);
  color: #f9fafb;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.ai-share-copy-btn:hover {
  transform: translateY(-1px);
}

/* ====== Модалка «Сохранить находку» (оболочка ai-share-modal) ====== */

.finding-save-dialog {
  position: relative;
  width: min(440px, 94vw);
}

.finding-save-close {
  position: absolute;
  top: 8px;
  right: 10px;
}

.finding-save-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finding-save-visibility {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.finding-save-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.finding-save-radio input {
  accent-color: #dc3545;
}

.finding-save-share-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.finding-save-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  font-size: 14px;
  color: #111827;
}

.finding-save-input:focus {
  outline: none;
  border-color: rgba(220, 53, 69, 0.55);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.12);
}

.finding-save-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.finding-save-actions--row .ai-share-copy-btn,
.finding-save-actions--row .finding-share-toggle-btn {
  flex: 1;
  width: auto;
}

.finding-save-actions--dual {
  align-items: stretch;
}

.finding-save-actions--dual .ai-share-copy-btn,
.finding-save-actions--dual .finding-share-toggle-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  font-size: 13px;
  padding-left: 10px;
  padding-right: 10px;
}

.finding-save-actions--triple {
  align-items: stretch;
}

.finding-save-actions--triple .ai-share-copy-btn,
.finding-save-actions--triple .finding-share-toggle-btn {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  padding-left: 8px;
  padding-right: 8px;
}

.finding-save-actions--triple .finding-icon-btn {
  flex: 0 0 40px;
  width: 40px;
  height: auto;
  min-height: 34px;
  align-self: stretch;
}

.finding-send-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-send-form .finding-share-field input,
.finding-send-form .finding-share-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.finding-save-cancel-btn--full {
  width: 100%;
  margin-top: 4px;
}

.finding-save-hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.finding-inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.finding-inbox-reply-btn {
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
}

.finding-save-cancel-btn {
  flex: 1;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
}

.finding-save-cancel-btn:hover {
  background: #f9fafb;
}

.finding-save-open-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(220, 53, 69, 0.08);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.finding-save-open-link:hover {
  background: rgba(220, 53, 69, 0.14);
  text-decoration: none;
}

.finding-save-share-block {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-open-row {
  margin-bottom: 4px;
}

/* ============================================================================
   ИНДИКАТОР ЗАПИСИ ГОЛОСА
   ============================================================================ */

.voice-recording-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 28px;
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  font-size: 15px;
  font-weight: 500;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-recording-indicator.active {
  display: flex;
}

.voice-recording-dot {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

@keyframes pulse-dot {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1); 
  }
  50% { 
    opacity: 0.6; 
    transform: scale(1.3); 
  }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
  }
  to { 
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Адаптация под мобильные устройства */
@media (max-width: 640px) {
  .attach-btn {
    left: 0;
    width: 20px;
    height: 22px;
  }

  .attach-btn svg {
    width: 15px;
    height: 15px;
    margin-left: -1px;
  }

  .search-input-wrapper input[type="search"] {
    padding-left: 38px;
    padding-right: 36px;
    font-size: 12px;
  }

  .search-input-wrapper.has-voice input[type="search"] {
    padding-right: 38px;
  }

  .search-input-wrapper.has-voice input[type="search"]::-webkit-search-cancel-button {
    margin-right: 6px;
  }

  .voice-btn {
    width: 24px;
    height: 24px;
    right: 7px;
  }

  .voice-btn svg {
    width: 18px;
    height: 18px;
  }

  .voice-recording-indicator {
    bottom: 16px;
    font-size: 14px;
    padding: 12px 20px;
  }
}

/* Мобильная адаптация AI‑карточки */

@media (max-width: 640px) {
  .search-card-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 2px auto 0;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .main-search-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .ai-result-container {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 0;
    padding: 12px 10px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .ai-result-content {
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }
}

/* ====== Модалки входящих и просмотра находки ====== */

.finding-panel-modal .finding-panel-dialog {
  position: relative;
  width: min(560px, 94vw);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
  overflow: hidden;
}

.finding-panel-modal .finding-view-dialog {
  width: min(760px, 96vw);
  padding: 8px 12px 12px;
}

@media (min-width: 769px) {
  .finding-panel-modal .finding-view-dialog {
    width: min(860px, 90vw);
  }
}

.finding-view-dialog > .finding-panel-close {
  top: 8px;
  right: 8px;
  z-index: 2;
}

.finding-view-dialog .finding-view-panel-body {
  margin-top: 2px;
  padding: 0;
}

.finding-dismiss-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #64748b;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.finding-dismiss-btn:hover {
  border-color: rgba(220, 53, 69, 0.42);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.82);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.finding-view-views .finding-views-control {
  min-width: 36px;
  height: 36px;
}

.finding-panel-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 28px 6px 0;
  color: #0f172a;
}

.finding-panel-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}

.finding-panel-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 2px;
}

.finding-panel-query {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 10px;
  line-height: 1.35;
}

.finding-inbox-dialog .finding-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finding-inbox-item {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.finding-inbox-item:hover {
  border-color: rgba(220, 53, 69, 0.35);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.finding-inbox-item--unread {
  border-color: rgba(220, 53, 69, 0.45);
  background: rgba(254, 242, 242, 0.5);
}

.finding-inbox-from {
  margin: 0 0 4px;
  font-size: 12px;
  color: #6b7280;
}

.finding-inbox-query {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.finding-inbox-date {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.finding-inbox-open-btn {
  display: inline-flex;
  margin-top: 8px;
  pointer-events: none;
}

.finding-inbox-skeleton {
  height: 88px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: finding-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes finding-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.finding-inbox-item--enter {
  animation: finding-inbox-item-in 0.35s ease both;
  animation-delay: var(--inbox-delay, 0ms);
}

@keyframes finding-inbox-item-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.finding-empty,
.finding-loading,
.finding-error {
  color: #6b7280;
  font-size: 14px;
}

.finding-inbox-empty {
  padding: 24px 16px;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
}

.finding-view-actions--row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.finding-view-actions--row > .finding-view-views,
.finding-view-actions--row > .finding-icon-btn,
.finding-view-actions--row > .finding-like-control {
  align-self: center;
  flex: 0 0 auto;
}

.finding-view-views {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 36px;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.finding-view-views .finding-views-control {
  margin: 0;
  vertical-align: middle;
}

.finding-share-toggle-btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.finding-share-toggle-btn:hover {
  background: #f9fafb;
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
}

.finding-share-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.finding-share-form[hidden] {
  display: none;
}

.finding-share-field input,
.finding-share-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  font: inherit;
  font-size: 13px;
  color: #111827;
  background: #fff;
}

.finding-share-field textarea {
  resize: vertical;
  min-height: 56px;
}

.finding-share-field input:focus,
.finding-share-field textarea:focus {
  outline: none;
  border-color: rgba(220, 53, 69, 0.55);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.finding-share-submit-btn {
  width: 100%;
}

.finding-feed-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.finding-feed-tabs {
  display: flex;
  gap: 6px;
}

.finding-activity-toolbar[hidden],
.finding-activity-thread-title[hidden],
.finding-activity-title[hidden],
.finding-activity-back[hidden],
.finding-activity-write[hidden] {
  display: none !important;
}

.finding-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  margin: 0 0 8px;
  flex-shrink: 0;
}

.finding-activity-header__main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.finding-activity-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.finding-activity-dialog .finding-activity-title,
.finding-activity-dialog .finding-activity-thread-title {
  flex: 1;
  margin: 0;
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finding-activity-back {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.finding-activity-back:hover {
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.5);
}

.finding-activity-write {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(220, 53, 69, 0.35);
  background: rgba(254, 242, 242, 0.55);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.finding-activity-write:hover {
  background: rgba(254, 242, 242, 0.95);
  border-color: rgba(220, 53, 69, 0.5);
}

.finding-activity-close {
  position: static;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.finding-activity-close:hover {
  border-color: rgba(220, 53, 69, 0.4);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.85);
}

.finding-activity-close span {
  display: block;
  margin-top: -2px;
  pointer-events: none;
}

.finding-activity-toolbar {
  margin-bottom: 8px;
}

.finding-activity-tabs {
  width: 100%;
}

.finding-activity-inbox-toolbar {
  margin-bottom: 4px;
}

.finding-dm-new-toolbar {
  width: 100%;
  margin: 0 0 10px;
  flex-shrink: 0;
}

.finding-activity-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(220, 53, 69, 0.2);
  background: rgba(254, 242, 242, 0.55);
}

.finding-activity-intro[hidden] {
  display: none !important;
}

.finding-activity-intro__text {
  flex: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.finding-activity-intro__dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.finding-activity-intro__dismiss:hover {
  color: #b91c1c;
  background: #fff;
}

.finding-activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px 20px;
}

.finding-activity-empty__icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
}

.finding-activity-empty__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.finding-activity-empty__hint {
  margin: 0 0 14px;
  max-width: 28em;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}

.finding-activity-empty__action {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.finding-activity-event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-activity-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid #eef0f3;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.finding-activity-event:hover {
  border-color: rgba(220, 53, 69, 0.25);
  background: rgba(254, 252, 252, 0.95);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.finding-activity-event__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  background: #f3f4f6;
}

.finding-activity-event--comment .finding-activity-event__icon {
  color: #2563eb;
  background: rgba(239, 246, 255, 0.95);
}

.finding-activity-event--finding .finding-activity-event__icon {
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.9);
}

.finding-activity-event__body {
  flex: 1;
  min-width: 0;
}

.finding-activity-event__type {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9ca3af;
}

.finding-activity-event--comment .finding-activity-event__type {
  color: #3b82f6;
}

.finding-activity-event--finding .finding-activity-event__type {
  color: #dc3545;
}

.finding-activity-event__text {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.4;
  color: #111827;
}

.finding-activity-event__time {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.finding-dm-dialog-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finding-dm-dialog-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.finding-dm-dialog-item:hover {
  background: rgba(249, 250, 251, 0.95);
}

.finding-dm-dialog-item--unread {
  background: rgba(254, 242, 242, 0.45);
}

.finding-dm-dialog-item--unread:hover {
  background: rgba(254, 242, 242, 0.7);
}

.finding-dm-dialog-item__avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
  color: #6b7280;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.finding-dm-dialog-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.finding-dm-dialog-item--unread .finding-dm-dialog-item__avatar {
  background: linear-gradient(145deg, #fee2e2, #fecaca);
  color: #b91c1c;
}

.finding-dm-dialog-item__body {
  flex: 1;
  min-width: 0;
}

.finding-dm-dialog-item__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.finding-dm-dialog-item__name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finding-dm-dialog-item__time {
  flex-shrink: 0;
  font-size: 11px;
  color: #9ca3af;
}

.finding-dm-dialog-item__bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finding-dm-dialog-item__preview {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finding-dm-dialog-item--unread .finding-dm-dialog-item__preview {
  color: #374151;
  font-weight: 500;
}

.finding-dm-dialog-item__badge {
  flex-shrink: 0;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.finding-dm-new-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.finding-dm-new-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
}

.finding-dm-new-form__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.finding-dm-new-submit {
  flex: 1;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  white-space: nowrap;
}

.finding-dm-new-cancel {
  flex-shrink: 0;
  min-height: 38px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 10px;
}

.finding-dm-new-cancel:hover {
  color: #b91c1c;
}

.finding-dm-new-suggest {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.finding-dm-new-suggest__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  text-align: left;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
}

.finding-dm-new-suggest__item:last-child {
  border-bottom: none;
}

.finding-dm-new-suggest__item:hover {
  background: rgba(254, 242, 242, 0.6);
  color: #b91c1c;
}

.finding-dm-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.finding-dm-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.finding-dm-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}

.finding-dm-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f3f4f6;
  align-self: flex-start;
}

.finding-dm-bubble--mine {
  align-self: flex-end;
  background: rgba(254, 242, 242, 0.95);
  border: 1px solid rgba(220, 53, 69, 0.15);
}

.finding-dm-bubble__text {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}

.finding-dm-bubble__time {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.finding-dm-attachment {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.finding-dm-attachment:hover {
  border-color: rgba(220, 53, 69, 0.35);
}

.finding-dm-attachment__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  margin-bottom: 4px;
}

.finding-dm-attachment__query {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: #374151;
}

.finding-dm-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 8px;
}

.finding-dm-compose__row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.finding-dm-compose__pending {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.finding-dm-compose__pending-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
}

.finding-dm-compose__pending-query {
  flex: 1;
  font-size: 13px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finding-dm-compose__pending-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.finding-dm-compose__attach {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.finding-dm-compose__attach:hover {
  border-color: rgba(220, 53, 69, 0.4);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.5);
}

.finding-dm-compose__attach svg {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.finding-dm-compose__input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
}

.finding-dm-compose__send {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid #c92a3a;
  background: linear-gradient(180deg, #e04555 0%, #c92a3a 100%);
  color: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.finding-dm-compose__send:hover {
  filter: brightness(1.05);
}

.finding-dm-compose__send:active {
  transform: scale(0.97);
}

.finding-dm-compose__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.finding-dm-compose__send svg {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.finding-dm-empty-thread {
  margin: 12px 0;
}

.finding-activity-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.finding-activity-tab-label {
  pointer-events: none;
}

.finding-activity-tab-badge {
  flex-shrink: 0;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.finding-dm-picker-dialog .finding-panel-body {
  max-height: min(50vh, 360px);
  overflow-y: auto;
}

.finding-dm-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-dm-picker-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.finding-dm-picker-item:hover {
  border-color: rgba(220, 53, 69, 0.35);
  background: rgba(254, 242, 242, 0.35);
}

.finding-dm-picker-item__query {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: #111827;
  margin-bottom: 4px;
}

.finding-dm-picker-item__date {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.finding-feed-tab {
  flex: 1;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}

.finding-feed-tab--active {
  border-color: rgba(220, 53, 69, 0.45);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.6);
}

.finding-feed-search {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
}

.finding-feed-preview {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.finding-feed-stats {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.finding-feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.finding-feed-action--active {
  border-color: rgba(220, 53, 69, 0.45);
  color: #b91c1c;
}

.finding-feed-author-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  text-align: left;
}

.finding-feed-author-btn:hover {
  color: #b91c1c;
}

.finding-feed-load-more {
  width: 100%;
  margin-top: 8px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.finding-author-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.finding-comments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.finding-comments-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.finding-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.finding-comment-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.finding-comment-author {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.finding-comment-body {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: #111827;
}

.finding-comment-date {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
}

.finding-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-comment-form textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  resize: vertical;
}

/* Unified finding list cards (feed, profile, inbox) */
.finding-list-card {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.finding-list-card:hover {
  border-color: rgba(220, 53, 69, 0.35);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.finding-list-card--unread {
  border-color: rgba(220, 53, 69, 0.45);
  background: rgba(254, 242, 242, 0.5);
}

.finding-list-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  min-width: 0;
}

.finding-list-card__author {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.finding-list-card__author:hover {
  color: #b91c1c;
}

.finding-list-card__followers {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.finding-list-card__followers-count {
  line-height: 1;
}

.finding-list-card__follow {
  margin-left: auto;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}

.finding-list-card__follow:hover {
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
}

.finding-list-card__follow--active {
  border-color: rgba(220, 53, 69, 0.55);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.6);
}

.finding-list-card__query {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

.finding-list-card__message {
  margin: 6px 0 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}

.finding-list-card__preview {
  margin: 6px 0 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.finding-list-card__date {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.finding-list-card__stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

.finding-list-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.finding-list-card__action--active {
  border-color: rgba(220, 53, 69, 0.55);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.6);
}

.finding-list-card--clickable {
  cursor: pointer;
}

.finding-list-card__owner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.finding-list-card__owner-head .finding-list-card__query {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.finding-views-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  cursor: default;
}

.finding-views-control:hover {
  border-color: #e5e7eb;
  color: #374151;
}

.finding-views-control__count {
  font-variant-numeric: tabular-nums;
}

.finding-views-icon {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.finding-list-card__owner-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.finding-list-card__visibility-select {
  flex-shrink: 0;
  max-width: 100%;
  padding: 4px 28px 4px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  appearance: auto;
}

.finding-list-card__visibility-select:hover {
  border-color: rgba(220, 53, 69, 0.35);
}

.finding-list-card__visibility-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

.finding-like-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  line-height: 1;
}

.finding-like-control:hover {
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
}

.finding-like-control--active {
  border-color: rgba(220, 53, 69, 0.55);
  color: #dc3545;
  background: rgba(254, 242, 242, 0.6);
}

.finding-like-control--active .finding-like-icon {
  fill: #dc3545;
  stroke: #dc3545;
}

.finding-like-icon {
  display: block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.finding-like-control__count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.finding-list-card__actions .finding-like-control {
  flex-shrink: 0;
}

.finding-comment-control {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
  gap: 3px;
}

.finding-comment-control__count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.finding-view-like-btn {
  min-width: 52px;
  justify-content: center;
}

.finding-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.finding-icon-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}

.finding-icon-btn:hover {
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
}

.finding-icon-btn.finding-views-control,
.finding-icon-btn.finding-comment-control,
.finding-icon-btn.finding-like-control {
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.finding-icon-btn.finding-views-control {
  cursor: default;
  opacity: 1;
}

.finding-icon-btn.finding-views-control:disabled {
  opacity: 1;
  color: #374151;
}

.finding-icon-btn.finding-views-control:hover,
.finding-icon-btn.finding-views-control:disabled:hover {
  border-color: #e5e7eb;
  color: #374151;
}

.finding-icon-btn.finding-like-control svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

.finding-icon-btn.finding-views-control svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

.finding-share-icon,
.finding-copy-icon,
.finding-save-icon,
.finding-open-icon,
.finding-comment-icon,
.finding-like-icon,
.finding-views-icon {
  display: block;
  flex-shrink: 0;
}

.finding-list-card__actions .finding-icon-btn {
  flex-shrink: 0;
}

.finding-follow-icon-btn {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.finding-view-actions--row .finding-like-control,
.finding-view-actions--row .finding-icon-btn,
.finding-view-actions--row .finding-views-control {
  flex: 0 0 auto;
}

.finding-list-card__delete {
  margin-top: 1px;
}

.finding-list-card__delete:hover {
  border-color: rgba(220, 53, 69, 0.45);
  color: #b91c1c;
}

.finding-list-card__dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.finding-list-card__dialog-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.finding-inbox-dialog-badge {
  flex-shrink: 0;
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.finding-inbox-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.finding-inbox-toolbar .finding-panel-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.finding-inbox-back-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

.finding-inbox-back-btn:hover {
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
}

/* Collapsible media blocks in finding view */
.finding-collapsible {
  margin-top: 10px;
}

.finding-collapsible-bar {
  display: flex;
  align-items: center;
}

.finding-collapsible-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

.finding-collapsible-toggle:hover {
  border-color: rgba(220, 53, 69, 0.35);
  color: #b91c1c;
}

.finding-collapsible.is-expanded .ai-sources-chevron,
.finding-collapsible.is-expanded .finding-collapsible-toggle .ai-sources-chevron {
  transform: rotate(180deg);
}

.finding-collapsible-body {
  margin-top: 8px;
}

.finding-collapsible-body[hidden] {
  display: none;
}

.finding-collapsible--media .finding-collapsible-body .ai-image-grid,
.finding-collapsible--media .finding-collapsible-body .ai-video-grid {
  margin-top: 0;
}

.finding-details-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finding-details-section--images .ai-image-grid,
.finding-details-section--videos .ai-video-grid {
  margin-top: 0;
}

#finding-share-menu-modal {
  z-index: 100002;
}

#finding-share-send-modal {
  z-index: 100003;
}

.finding-share-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding-share-menu-actions .ai-share-copy-btn,
.finding-share-menu-actions .finding-share-toggle-btn {
  width: 100%;
  justify-content: center;
}

.finding-fly-ghost {
  position: fixed;
  z-index: 100001;
  pointer-events: none;
  border-radius: 12px;
  background: rgba(254, 242, 242, 0.92);
  border: 2px solid rgba(220, 53, 69, 0.55);
  box-shadow: 0 6px 24px rgba(220, 53, 69, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 1.05s cubic-bezier(0.32, 0.08, 0.24, 1),
    opacity 1.05s ease;
  transform: translate(0, 0) scale(1);
  opacity: 1;
}

.finding-fly-ghost__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #dc3545;
  box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.18);
}

#menuButton.finding-menu-pulse {
  animation: finding-menu-pulse 0.52s ease;
}

@keyframes finding-menu-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }
  45% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px rgba(220, 53, 69, 0.28);
  }
}
/* ========== Тёмная тема (только при data-theme="dark") ========== */
html[data-theme="dark"] .menu-activity-bell,
html[data-theme="dark"] .menu-button {
  background:
    linear-gradient(180deg, rgba(36, 44, 58, 0.94) 0%, rgba(22, 28, 38, 0.92) 100%);
  border-color: rgba(238, 241, 246, 0.14);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.35);
  color: #e5e7eb;
}

html[data-theme="dark"] .menu-activity-bell:hover,
html[data-theme="dark"] .menu-button:hover {
  background:
    linear-gradient(180deg, rgba(44, 54, 72, 0.96) 0%, rgba(28, 36, 48, 0.94) 100%);
  border-color: rgba(217, 44, 44, 0.5);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 14px 30px rgba(0, 0, 0, 0.4),
    0 0 0 3px rgba(217, 44, 44, 0.16);
}

html[data-theme="dark"] .menu-activity-bell {
  color: #d1d5db;
}

html[data-theme="dark"] .menu-activity-bell:hover {
  color: #f87171;
}

html[data-theme="dark"] .menu-activity-bell__badge {
  border-color: #1a2130;
}

html[data-theme="dark"] .menu-button span.n {
  color: #eef1f6;
}

html[data-theme="dark"] .menu-button[aria-expanded="true"] {
  background:
    linear-gradient(180deg, rgba(52, 28, 32, 0.96) 0%, rgba(32, 20, 24, 0.94) 100%);
  border-color: rgba(217, 44, 44, 0.55);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 10px 26px rgba(217, 44, 44, 0.18),
    0 0 0 3px rgba(217, 44, 44, 0.14);
}

html[data-theme="dark"] .menu-button[aria-expanded="true"] span.n {
  color: #f3f5f9;
}

html[data-theme="dark"] .menu-button-unread-dot {
  border-color: #1a2130;
}

@media (prefers-reduced-motion: reduce) {
  .menu-activity-bell,
  .menu-button,
  .menu-button span.s,
  .menu-button span.n {
    transition: none;
  }
  .menu-activity-bell:hover,
  .menu-button:hover,
  .menu-activity-bell:active,
  .menu-button:active {
    transform: none;
  }
}

html[data-theme="dark"] .menu-container {
  background:
    linear-gradient(180deg, rgba(28, 36, 48, 0.96) 0%, rgba(18, 24, 34, 0.94) 100%);
  border-color: rgba(238, 241, 246, 0.12);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 18px 40px rgba(0, 0, 0, 0.45);
  color: #eef1f6;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  scrollbar-color: rgba(238, 241, 246, 0.22) transparent;
}

html[data-theme="dark"] .menu-container a,
html[data-theme="dark"] .menu-container .menu-item {
  color: #e8ecf2 !important;
}

html[data-theme="dark"] .menu-container a:hover,
html[data-theme="dark"] .menu-container .menu-item:hover {
  background-color: rgba(217, 44, 44, 0.14) !important;
  color: #fff !important;
}

html[data-theme="dark"] .submenu-container {
  border-left-color: rgba(238, 241, 246, 0.1);
}

html[data-theme="dark"] .submenu-group-label {
  color: #9aa3b2;
}

html[data-theme="dark"] .menu-item[data-submenu]:after {
  color: #9aa3b2;
}

html[data-theme="dark"] .menu-item[data-submenu][aria-expanded="true"]:after {
  color: #f87171;
}

html[data-theme="dark"] .submenu-container a:hover {
  background-color: rgba(217, 44, 44, 0.16) !important;
  color: #ffb4ae !important;
  transform: none;
}

html[data-theme="dark"] .menu-chrome {
  border-top-color: rgba(238, 241, 246, 0.1);
}

html[data-theme="dark"] .menu-chrome__lang:hover,
html[data-theme="dark"] .menu-chrome__lang:focus-within {
  background-color: rgba(238, 241, 246, 0.06);
}

html[data-theme="dark"] .menu-chrome__lang .lang-selector {
  border-color: rgba(238, 241, 246, 0.16);
  background-color: rgba(10, 14, 20, 0.75);
  color: #d1d5db;
}

html[data-theme="dark"] .menu-theme-btn,
html[data-theme="dark"] .menu-settings-btn {
  color: #9aa3b2;
}

html[data-theme="dark"] .menu-theme-btn:hover,
html[data-theme="dark"] .menu-theme-btn:focus-visible,
html[data-theme="dark"] .menu-settings-btn:hover,
html[data-theme="dark"] .menu-settings-btn:focus-visible {
  color: #e5e7eb;
  background: rgba(238, 241, 246, 0.08);
}

html[data-theme="dark"] .menu-settings-btn[aria-expanded="true"] {
  color: #f87171;
  background: rgba(217, 44, 44, 0.16);
}

html[data-theme="dark"] .menu-settings-panel {
  background-color: rgba(22, 28, 38, 0.98);
  border-color: rgba(238, 241, 246, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .menu-settings-panel a,
html[data-theme="dark"] .menu-settings-panel .a11y-toggle {
  color: #e8ecf2 !important;
}

html[data-theme="dark"] .game-placeholder,
html[data-theme="dark"] .menu-container a.game-placeholder,
html[data-theme="dark"] .tool-placeholder:hover {
  background-color: rgba(238, 241, 246, 0.05) !important;
  color: #9aa3b2 !important;
}

/* Колокольчик / activity modal — тёмная тема */
html[data-theme="dark"] .ai-share-dialog.finding-activity-dialog,
html[data-theme="dark"] .finding-panel-dialog.finding-activity-dialog,
html[data-theme="dark"] .finding-inbox-dialog {
  background: rgba(18, 22, 30, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
  color: #eef0f4;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .finding-activity-title,
html[data-theme="dark"] .finding-activity-thread-title,
html[data-theme="dark"] .finding-panel-title {
  color: #f3f5f8;
}

html[data-theme="dark"] .finding-activity-back,
html[data-theme="dark"] .finding-activity-close,
html[data-theme="dark"] .finding-panel-close,
html[data-theme="dark"] .finding-inbox-back-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef0f4;
}

html[data-theme="dark"] .finding-activity-back:hover,
html[data-theme="dark"] .finding-activity-close:hover,
html[data-theme="dark"] .finding-panel-close:hover {
  background: rgba(255, 77, 87, 0.16);
  border-color: rgba(255, 77, 87, 0.4);
  color: #ff6b73;
}

html[data-theme="dark"] .finding-activity-write {
  background: rgba(255, 77, 87, 0.14);
  border-color: rgba(255, 77, 87, 0.4);
  color: #ff8a90;
}

html[data-theme="dark"] .finding-activity-write:hover {
  background: rgba(255, 77, 87, 0.22);
  color: #ffb0b5;
}

html[data-theme="dark"] .finding-feed-tab,
html[data-theme="dark"] .finding-activity-tab {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #c5ccd8;
}

html[data-theme="dark"] .finding-feed-tab--active,
html[data-theme="dark"] .finding-activity-tab.finding-feed-tab--active,
html[data-theme="dark"] .finding-feed-tab[aria-selected="true"] {
  background: rgba(255, 77, 87, 0.18);
  border-color: rgba(255, 77, 87, 0.4);
  color: #ff8a90;
}

html[data-theme="dark"] .finding-activity-intro {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #c5ccd8;
}

html[data-theme="dark"] .finding-activity-intro__dismiss {
  color: #9aa3b2;
}

html[data-theme="dark"] .finding-activity-event,
html[data-theme="dark"] .finding-inbox-item,
html[data-theme="dark"] .finding-list-card {
  background: rgba(28, 32, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
  color: #eef0f4;
}

html[data-theme="dark"] .finding-activity-event:hover,
html[data-theme="dark"] .finding-inbox-item:hover,
html[data-theme="dark"] .finding-list-card:hover {
  background: rgba(40, 46, 58, 0.98);
  border-color: rgba(255, 77, 87, 0.3);
}

html[data-theme="dark"] .finding-activity-event__icon {
  background: rgba(255, 255, 255, 0.08);
  color: #c5ccd8;
}

html[data-theme="dark"] .finding-activity-event__type,
html[data-theme="dark"] .finding-activity-event__time,
html[data-theme="dark"] .finding-inbox-date,
html[data-theme="dark"] .finding-activity-empty__hint,
html[data-theme="dark"] .finding-panel-hint {
  color: #9aa3b2;
}

html[data-theme="dark"] .finding-activity-event__text,
html[data-theme="dark"] .finding-inbox-query,
html[data-theme="dark"] .finding-inbox-from,
html[data-theme="dark"] .finding-activity-empty__title {
  color: #eef0f4;
}

html[data-theme="dark"] .finding-inbox-item--unread {
  background: rgba(255, 77, 87, 0.08);
  border-color: rgba(255, 77, 87, 0.25);
}

html[data-theme="dark"] .finding-inbox-open-btn,
html[data-theme="dark"] .finding-inbox-reply-btn,
html[data-theme="dark"] .finding-activity-empty__action {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef0f4;
}

html[data-theme="dark"] .finding-inbox-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .finding-dm-panel,
html[data-theme="dark"] .finding-activity-panel {
  color: #eef0f4;
}

html[data-theme="dark"] .ai-share-backdrop {
  background: rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .finding-list-card--unread {
  background: rgba(255, 77, 87, 0.12) !important;
  border-color: rgba(255, 77, 87, 0.35) !important;
  color: #f2f4f8 !important;
}


/* ========== Theme: dark — share dialog ========== */
html[data-theme="dark"] .ai-share-dialog {
  background: #161a22 !important;
  border-color: rgba(238, 240, 244, 0.14) !important;
  color: #f2f4f8 !important;
}
html[data-theme="dark"] .ai-share-title { color: #f2f4f8 !important; }
html[data-theme="dark"] .ai-share-close { color: #f2f4f8 !important; }
