/* ============================================
   RF4 App — Full Stylesheet (Dark Theme)
   Colors: var(--rf4-bg), var(--rf4-bg-elevated), var(--rf4-bg-muted), var(--rf4-border),
   var(--rf4-accent), #238636, var(--rf4-text-muted), var(--rf4-text), #f85149
   ============================================ */

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --rf4-bg: #0d1117;
  --rf4-bg-elevated: #161b22;
  --rf4-bg-muted: #21262d;
  --rf4-border: #30363d;
  --rf4-text: #e6edf3;
  --rf4-text-muted: #8b949e;
  --rf4-text-soft: #c9d1d9;
  --rf4-accent: #58a6ff;
  --rf4-accent-soft: rgba(88, 166, 255, 0.12);
  --rf4-share: #ffb454;
  --rf4-share-soft: rgba(255, 180, 84, 0.16);
  --rf4-share-border: rgba(255, 180, 84, 0.45);
  --rf4-shadow: rgba(0, 0, 0, 0.35);
  --rf4-loading-scrim: rgba(22, 27, 34, 0.88);
}

html[data-theme="light"] {
  color-scheme: light;
  --rf4-bg: #f6f8fa;
  --rf4-bg-elevated: #ffffff;
  --rf4-bg-muted: #eaeef2;
  --rf4-border: #d0d7de;
  --rf4-text: #1f2328;
  --rf4-text-muted: #656d76;
  --rf4-text-soft: #424a53;
  --rf4-accent: #0969da;
  --rf4-accent-soft: rgba(9, 105, 218, 0.12);
  --rf4-share: #c45c00;
  --rf4-share-soft: rgba(196, 92, 0, 0.12);
  --rf4-share-border: rgba(196, 92, 0, 0.35);
  --rf4-shadow: rgba(31, 35, 40, 0.12);
  --rf4-loading-scrim: rgba(246, 248, 250, 0.92);
}

/* --------------------------------------------
   1) RESET
   -------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
  margin: 0;
}

body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--rf4-bg, var(--rf4-bg));
  color: var(--rf4-text, var(--rf4-text));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

/* --- Квалификации --- */
.tab-content-inner.tab-content-qual {
  overflow: hidden;
  gap: 0;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.tab-content-qual {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.qual-layout {
  width: min(100%, 920px);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.qual-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.qual-head-top {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.qual-head .tab-page-title {
  margin: 0;
  font-size: 1.15rem;
}

.qual-head-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}

.qual-type-tabs-wrap {
  overflow-x: auto;
  padding-bottom: 0.1rem;
  margin: 0 -0.15rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.qual-type-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-width: min-content;
}

.qual-type-tab {
  flex-shrink: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.qual-type-tab:hover {
  border-color: var(--rf4-border);
  background: var(--rf4-bg-muted);
}

.qual-type-tab.active {
  border-color: var(--rf4-accent);
  background: rgba(56, 139, 253, 0.12);
  color: var(--rf4-accent);
}

.qual-type-tab:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.qual-reward {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.08), rgba(22, 27, 34, 0.95));
  border: 1px solid rgba(210, 153, 34, 0.28);
  border-radius: 12px;
}

.qual-reward-inner {
  display: contents;
}

.qual-reward-visual {
  grid-column: 1;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  padding: 0.35rem;
  border-radius: 10px;
  background: var(--rf4-bg);
  border: 1px solid rgba(210, 153, 34, 0.22);
  box-sizing: border-box;
}

.qual-img-wrap--broken {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qual-img-wrap--broken::after {
  content: "🏆";
  font-size: 1.75rem;
  opacity: 0.45;
}

.qual-img-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: var(--rf4-bg);
  cursor: zoom-in;
  overflow: hidden;
  flex-shrink: 0;
}

.qual-img-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.qual-img-zoom {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--rf4-text);
  font-size: 0.95rem;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.qual-img-btn:hover .qual-img-zoom,
.qual-img-btn:focus-visible .qual-img-zoom {
  opacity: 1;
  transform: scale(1);
}

.qual-reward-img-btn {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 0;
  padding: 0;
  box-sizing: border-box;
  background: transparent;
}

.qual-reward-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.qual-reward-text {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  grid-column: 2;
}

.qual-reward:not(:has(.qual-reward-visual)) .qual-reward-text {
  grid-column: 1 / -1;
}

.qual-reward-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rf4-text-muted);
}

.qual-reward-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.qual-reward-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--rf4-text);
}

.qual-reward-type {
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  line-height: 1.3;
}

.qual-reward-hint {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.qual-stages-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.qual-stages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qual-stage {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: stretch;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow: hidden;
}

.qual-stage:hover {
  border-color: #3d444d;
}

.qual-stage-media {
  position: relative;
  align-self: stretch;
  min-height: 124px;
  background: var(--rf4-bg);
  border-right: 1px solid var(--rf4-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qual-stage-media--empty {
  background: linear-gradient(180deg, var(--rf4-bg), var(--rf4-bg-elevated));
}

.qual-stage-no-img {
  font-size: 2rem;
  opacity: 0.35;
}

.qual-stage-img-btn {
  width: 100%;
  min-height: 124px;
  height: 100%;
  align-self: stretch;
  border-radius: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  box-sizing: border-box;
  background: transparent;
}

.qual-stage-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.qual-stage-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-accent);
  color: var(--rf4-accent);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.qual-stage-body {
  min-width: 0;
  padding: 0.85rem 0.95rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
}

.qual-stage-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--rf4-text);
}

.qual-stage-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qual-task {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-bg-muted);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.qual-task-num {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 0.05rem;
}

.qual-task-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--rf4-text-soft);
}

.qual-loading,
.qual-empty,
.qual-load-error {
  color: var(--rf4-text-muted);
  margin: 0;
}

.qual-note {
  margin: 0.5rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .qual-layout {
    width: 100%;
  }

  .qual-reward {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .qual-reward-text {
    align-items: center;
  }

  .qual-stage {
    grid-template-columns: 1fr;
  }

  .qual-stage-media {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rf4-bg-muted);
  }

  .qual-stage-img-btn {
    min-height: 0;
    height: 148px;
  }
}

/* --------------------------------------------
   2) LOAD OVERLAY
   -------------------------------------------- */
.load-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: block;
  background: var(--rf4-bg);
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.load-overlay.load-overlay-done {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

body.rf4-qt-desktop .load-overlay.load-overlay-done {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

/* boot.html: контент подгружается в #rf4BodyHost — на весь экран */
#rf4BodyHost {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

body:not(.rf4-boot-ready) #rf4BodyHost {
  visibility: hidden;
  pointer-events: none;
}

html.rf4-qt-desktop,
body.rf4-qt-desktop {
  background: var(--rf4-bg) !important;
}

/* WebView2 + Qt: backdrop-filter → белый/серый прямоугольник в углу */
body.rf4-desktop-shell,
body.rf4-desktop-shell *,
body.rf4-qt-desktop,
body.rf4-qt-desktop * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Desktop shell (Qt + WebView2): native <select> → белый прямоугольник в (0,0) */
body.rf4-desktop-shell select,
body.rf4-qt-desktop select {
  display: none !important;
  pointer-events: none !important;
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

body.rf4-desktop-shell .tab-panel.active select,
body.rf4-desktop-shell .modal.open select,
body.rf4-desktop-shell .modal-settings-wrap.open select,
body.rf4-desktop-shell .auth-gate.open select,
body.rf4-qt-desktop .tab-panel.active select,
body.rf4-qt-desktop .modal.open select,
body.rf4-qt-desktop .modal-settings-wrap.open select,
body.rf4-qt-desktop .auth-gate.open select {
  display: inline-block !important;
  pointer-events: auto !important;
  max-height: none !important;
  overflow: visible !important;
  opacity: 1 !important;
}

/* Админ-каталог: select в ряд с «Привязать» / редкость — всегда видимый блок */
body.rf4-desktop-shell .admin-catalog-modal.open select.admin-catalog-field-input,
body.rf4-qt-desktop .admin-catalog-modal.open select.admin-catalog-field-input {
  display: block !important;
  width: 100% !important;
  min-height: 36px !important;
  box-sizing: border-box;
}

body.rf4-desktop-shell .admin-catalog-modal.open .admin-catalog-tag-add-row select,
body.rf4-qt-desktop .admin-catalog-modal.open .admin-catalog-tag-add-row select {
  display: block !important;
  flex: 1 1 12rem !important;
  min-width: 10rem !important;
  min-height: 36px !important;
  width: auto !important;
}

body.rf4-qt-desktop .rf4-qt-select-slot {
  display: none !important;
}

.load-overlay-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.load-overlay-logo {
  display: block;
  width: min(80vmin, 80%);
  height: min(80vmin, 80%);
  max-width: 80%;
  max-height: 80%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  opacity: 0.42;
  user-select: none;
  flex-shrink: 0;
}

.load-overlay-inner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.5rem;
  pointer-events: none;
}

.load-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1.75rem;
  min-width: 200px;
  max-width: min(92vw, 360px);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  box-shadow: 0 8px 28px var(--rf4-shadow);
  pointer-events: auto;
}

.load-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 3px solid var(--rf4-border);
  border-top-color: var(--rf4-accent);
  border-radius: 50%;
  animation: load-spin 0.9s linear infinite;
}

@keyframes load-spin {
  to {
    transform: rotate(360deg);
  }
}

.load-text {
  font-size: 0.95rem;
  color: var(--rf4-text);
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.load-progress-wrap {
  width: min(320px, 88vw);
  margin: 0.75rem auto 0;
}

.load-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  overflow: hidden;
}

.load-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563a8, var(--rf4-accent));
  transition: width 0.25s ease;
}

.load-progress-meta {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  font-variant-numeric: tabular-nums;
}

.load-progress-intro {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--rf4-text-soft);
  text-align: center;
}

.load-progress-tip {
  margin: 0.55rem 0 0;
  padding: 0 0.25rem;
  max-width: min(88vw, 340px);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--rf4-text-muted);
  font-style: italic;
  text-align: center;
  min-height: 1.35em;
}

.load-version {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
}

.load-version-error {
  color: #ffb4b4;
  font-weight: 600;
}

.load-boot-error {
  width: min(320px, 88vw);
  margin-top: 0.35rem;
  text-align: center;
}

.load-boot-error-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffb4b4;
}

.load-boot-error-text {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #9da7b3;
}

.load-boot-error-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.load-boot-error-btn {
  width: 100%;
  justify-content: center;
}

.load-overlay-panel.is-boot-error .load-spinner,
.load-overlay-panel.is-boot-error .load-text,
.load-overlay-panel.is-boot-error .load-progress-wrap,
.load-overlay-panel.is-boot-error .load-progress-tip,
.load-overlay-panel.is-boot-error .load-version {
  display: none !important;
}

.load-version-link {
  color: var(--rf4-accent);
  text-decoration: underline;
}

.load-version-link:hover {
  color: var(--rf4-accent);
}

/* --------------------------------------------
   3) HEADER
   -------------------------------------------- */
.header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--rf4-bg-elevated);
  border-bottom: 1px solid var(--rf4-border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.header-brand {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  flex-shrink: 0;
}

.header-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-center {
  flex: 1;
  min-width: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 0 0.5rem;
}

body.music-mini-visible .header-center {
  display: flex;
}

.header-center .music-mini-bar {
  width: min(100%, 420px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.settings-discord-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.settings-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-row-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-theme-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--rf4-text);
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.header-theme-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.header-theme-icon {
  line-height: 1;
}

html[data-theme="light"] .header-theme-btn {
  color: #9a6700;
  border-color: rgba(210, 153, 34, 0.45);
  background: #fff8c5;
}

html[data-theme="light"] .header-theme-btn:hover {
  background: #fae17d;
  border-color: #d4a72c;
  color: #7d4e00;
}

.header-whats-new-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--rf4-text);
  font-size: 1.25rem;
  position: relative;
  flex-shrink: 0;
}

.header-whats-new-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}

.header-whats-new-btn.has-unseen {
  border-color: rgba(240, 180, 41, 0.5);
}

.header-whats-new-btn.has-unseen:hover {
  border-color: #f0b429;
}

.header-whats-new-icon {
  line-height: 1;
  font-size: 1.15rem;
}

.header-whats-new-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f85149;
  box-shadow: 0 0 0 2px var(--rf4-bg);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.header-whats-new-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.header-budilnik-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--rf4-text);
  font-size: 1.25rem;
}

.header-budilnik-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}

.header-budilnik-icon {
  line-height: 1;
}

.header-music-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--rf4-text);
  font-size: 1.25rem;
}

.header-music-btn:hover,
.header-music-btn.music-active {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}

.header-music-icon {
  line-height: 1;
}

.settings-music-folder {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.settings-music-folder-path {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.stats,
.header-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.header-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(33, 38, 45, 0.92);
  border: 1px solid var(--rf4-border);
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
}

.header-stat-label {
  color: var(--rf4-text-muted);
  font-weight: 500;
}

.header-stat-value {
  color: var(--rf4-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.header-stat-chip--online {
  border-color: rgba(63, 185, 80, 0.4);
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.16), rgba(33, 38, 45, 0.95));
  box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.08);
}

.header-stat-chip--online .header-stat-label {
  color: #7ee787;
}

.header-stat-chip--online .header-stat-value {
  color: #3fb950;
}

.header-stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 2px rgba(63, 185, 80, 0.2), 0 0 8px rgba(63, 185, 80, 0.55);
  flex-shrink: 0;
  animation: header-online-pulse 2.4s ease-in-out infinite;
}

@keyframes header-online-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(0.92); }
}

.load-overlay.update-overlay {
  z-index: 10050;
}

.update-overlay-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rf4-text);
  letter-spacing: 0.01em;
}

.load-overlay.update-overlay.load-overlay-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.header-update-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-update-btn {
  flex-shrink: 0;
  padding: 0.32rem 0.75rem;
  border: 1px solid #238636;
  border-radius: 999px;
  background: linear-gradient(180deg, #2ea043 0%, #238636 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(35, 134, 54, 0.25);
}

.header-update-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.header-update-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.header-update-btn--launcher {
  background: linear-gradient(180deg, var(--rf4-border) 0%, var(--rf4-bg-muted) 100%);
  border-color: var(--rf4-border);
  box-shadow: none;
}

.header-update-btn--launcher:hover:not(:disabled) {
  border-color: var(--rf4-accent);
}

.update-restart-modal {
  z-index: 12050;
}

.update-restart-content {
  max-width: 420px;
  text-align: center;
}

.update-restart-title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.update-restart-text {
  margin: 0 0 1rem;
  color: var(--rf4-text-soft);
  line-height: 1.45;
}

.update-restart-actions {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.update-overlay-done {
  margin-top: 1rem;
  text-align: center;
}

.update-overlay-done-text {
  margin: 0 0 1rem;
  color: var(--rf4-text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.update-overlay-close-btn {
  min-width: 200px;
}

.mandatory-update-gate {
  z-index: 12060;
}

.mandatory-update-gate.open {
  display: flex;
}

.mandatory-update-card {
  max-width: 420px;
  text-align: center;
}

.mandatory-update-text {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--rf4-text-soft);
}

.mandatory-update-version {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.mandatory-update-btn {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
}

.update-overlay-skip-btn {
  margin-top: 0.55rem;
}

.header-version.version-update-pending {
  color: #3fb950;
}

.game-status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  background: rgba(33, 38, 45, 0.85);
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  font-size: 0.85rem;
}

.game-status-label {
  color: var(--rf4-text-muted);
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  white-space: nowrap;
}

.game-status-port {
  color: var(--rf4-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
}

.game-status-time {
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
}

.header-notify-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
  cursor: pointer;
  position: relative;
}

.header-notify-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.header-user-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 210px;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--rf4-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.header-user-chip:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}

.header-user-chip.is-connecting .header-user-meta {
  color: var(--rf4-accent);
}

.header-user-chip.is-guest .header-user-meta {
  color: var(--rf4-text-muted);
}

.header-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--rf4-border), var(--rf4-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.header-avatar-xp-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.header-user-chip:not(.is-guest) {
  overflow: visible;
}

.header-submission-notify-badge {
  position: absolute;
  top: -2px;
  left: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: #f85149;
  border-radius: 9px;
  box-shadow: 0 0 0 2px var(--rf4-bg);
  z-index: 3;
  cursor: pointer;
}

.header-user-chip.has-submission-notify .header-user-name {
  color: var(--rf4-accent);
}

.avatar-xp-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-xp-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 2;
}

.avatar-xp-ring-bg {
  fill: none;
  stroke: var(--rf4-border);
  stroke-width: 2.8;
}

.avatar-xp-ring-fill {
  fill: none;
  stroke: #3fb950;
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease, stroke 0.25s ease;
  filter: drop-shadow(0 0 4px rgba(63, 185, 80, 0.35));
}

.avatar-xp-wrap.is-max .avatar-xp-ring-fill {
  stroke: #d4a72c;
  filter: drop-shadow(0 0 5px rgba(212, 167, 44, 0.45));
}

.avatar-xp-lvl-side {
  position: absolute;
  z-index: 3;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.avatar-xp-lvl-side--current {
  left: -0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--rf4-accent);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.avatar-xp-lvl-side--next {
  right: -0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: var(--rf4-text-muted);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.header-avatar-xp-wrap .avatar-xp-ring {
  opacity: 1;
}

.header-avatar-xp-wrap .avatar-xp-lvl-side {
  display: none;
}

.avatar-xp-wrap.is-hidden-xp .avatar-xp-ring,
.avatar-xp-wrap.is-hidden-xp .avatar-xp-lvl-side {
  opacity: 0 !important;
  visibility: hidden;
}

.avatar-xp-wrap--profile {
  width: 76px;
  height: 76px;
}

.avatar-xp-wrap--profile .avatar-xp-ring-bg,
.avatar-xp-wrap--profile .avatar-xp-ring-fill {
  stroke-width: 3.5;
}

.avatar-xp-wrap--profile .avatar-xp-lvl-side--current {
  left: -1.55rem;
  font-size: 1.1rem;
}

.avatar-xp-wrap--profile .avatar-xp-lvl-side--next {
  right: -1.55rem;
  font-size: 0.95rem;
  color: var(--rf4-text-muted);
}

.avatar-xp-wrap--profile .avatar-xp-ring,
.avatar-xp-wrap--profile .avatar-xp-lvl-side {
  opacity: 1;
}

.avatar-xp-wrap--profile .account-avatar-host {
  position: relative;
  z-index: 1;
  line-height: 0;
}

.avatar-xp-meta {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: var(--rf4-text-muted);
  text-align: center;
  max-width: 6.5rem;
  line-height: 1.25;
}

.user-profile-hero .account-avatar-col {
  padding: 0 1.55rem;
}

.header-user-avatar.has-image {
  background: var(--rf4-border);
}

.header-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-user-avatar-initial {
  line-height: 1;
}

.header-user-text {
  min-width: 0;
  flex: 1;
  text-align: left;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.header-user-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
}

.header-user-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--rf4-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 148px;
}

.header-notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: #f85149;
  border-radius: 9px;
}

.header-version {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
}

/* --------------------------------------------
   4) APP BODY & SIDEBAR
   -------------------------------------------- */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  flex-shrink: 0;
  width: var(--sidebar-w, 200px);
  min-height: 0;
  background: var(--rf4-bg-elevated);
  border-right: 1px solid var(--rf4-border);
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0 0.25rem;
  overflow: hidden;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Верх меню скроллится; низ (руководство / настройки) всегда на экране */
.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 148, 158, 0.45) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 148, 158, 0.45);
  border-radius: 6px;
}

.sidebar-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rf4-border);
  padding-top: 0.2rem;
  margin-top: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  margin: 0 0.25rem;
  color: var(--rf4-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

/* 14″ Full HD + масштаб Windows: меньше padding, чтобы влезало */
@media (max-height: 900px) {
  .nav-item {
    padding: 0.4rem 0.85rem;
    font-size: 0.84rem;
    gap: 0.45rem;
  }

  .nav-icon,
  .nav-icon-img {
    width: 18px;
    height: 18px;
  }

  .nav-icon-xi {
    width: 26px;
    height: 20px;
  }
}

@media (max-height: 760px) {
  .sidebar {
    padding: 0.2rem 0 0.15rem;
  }

  .nav-item {
    padding: 0.28rem 0.7rem;
    font-size: 0.78rem;
    gap: 0.35rem;
    border-radius: 6px;
  }

  .nav-icon,
  .nav-icon-img {
    width: 16px;
    height: 16px;
  }
}

.nav-item .nav-icon,
.nav-item .nav-icon-img,
.nav-item .nav-label {
  -webkit-user-drag: none;
  pointer-events: none;
}

.nav-item:hover {
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
}

.nav-item.active {
  color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.12);
  font-weight: 500;
}

.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.nav-icon--image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.9;
}

.nav-icon-xi {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 22px;
}

.nav-icon-xi-svg {
  display: block;
  overflow: visible;
}

.nav-icon-xi-svg .xi-glyphs {
  fill: currentColor;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-item.active .nav-icon-xi-svg .xi-glyphs {
  font-weight: 900;
}


.nav-item-guide {
  margin-top: 0;
  color: #9ccc65;
}

.nav-item-guide .nav-label {
  color: #9ccc65;
}

.nav-item-guide:hover {
  color: #c5e1a5;
  background: rgba(139, 195, 74, 0.12);
}

.nav-item-guide:hover .nav-label {
  color: #c5e1a5;
}

.nav-item-guide.active {
  color: #aed581;
  background: rgba(139, 195, 74, 0.16);
}

.nav-item-guide.active .nav-label {
  color: #aed581;
  font-weight: 600;
}

.nav-item-discord {
  color: #b5bac1;
}

.nav-item-discord .nav-label {
  color: #b5bac1;
}

.nav-item-discord:hover {
  color: #dee0ff;
  background: rgba(88, 101, 242, 0.14);
}

.nav-item-discord:hover .nav-label {
  color: #dee0ff;
}

.nav-item-share {
  color: var(--rf4-share);
  background: var(--rf4-share-soft);
  border: 1px solid var(--rf4-share-border);
  border-radius: 8px;
  font-weight: 600;
}

.nav-item-share .nav-icon {
  filter: none;
}

.nav-item-share .nav-label {
  color: var(--rf4-share);
  font-weight: 700;
}

.nav-item-share:hover {
  color: var(--rf4-share);
  background: rgba(255, 180, 84, 0.28);
  border-color: var(--rf4-share);
}

.nav-item-share:hover .nav-label {
  color: var(--rf4-share);
}

.nav-item-settings {
  border-top: 1px solid var(--rf4-bg-muted);
  margin-top: 0.35rem;
  padding-top: 0.55rem;
}

.nav-item-devchat {
  margin-top: 0.15rem;
  position: relative;
  color: #3fb950;
  white-space: nowrap;
}

.nav-item-devchat .nav-label {
  color: #3fb950;
  font-weight: 600;
  white-space: nowrap;
}

.nav-item-devchat:hover {
  color: #56d364;
  background: rgba(63, 185, 80, 0.12);
}

.nav-item-devchat:hover .nav-label {
  color: #56d364;
}

.nav-item-devchat.has-unread .nav-label {
  color: #56d364;
}

.nav-devchat-badge {
  position: absolute;
  top: 6px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: #3fb950;
  border-radius: 9px;
  box-shadow: 0 0 0 2px var(--rf4-bg);
}

.nav-item-admin {
  margin-top: 0.15rem;
  position: relative;
}

.nav-item-bazaar {
  position: relative;
  color: #e3b341;
  background: rgba(227, 179, 65, 0.1);
  border: 1px solid rgba(227, 179, 65, 0.28);
  border-radius: 8px;
}

.nav-item-bazaar .nav-label {
  color: #e3b341;
  font-weight: 600;
}

.nav-item-bazaar:hover {
  color: #f0c14e;
  background: rgba(227, 179, 65, 0.18);
  border-color: rgba(227, 179, 65, 0.5);
}

.nav-item-bazaar:hover .nav-label,
.nav-item-bazaar.active .nav-label {
  color: #f0c14e;
}

.nav-item-bazaar.active {
  background: rgba(227, 179, 65, 0.16);
  border-color: rgba(227, 179, 65, 0.45);
}

.nav-bazaar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: #f0883e;
  border-radius: 9px;
  box-shadow: 0 0 0 2px var(--rf4-bg-elevated, var(--rf4-bg));
  pointer-events: none;
}

.nav-bazaar-badge[hidden] {
  display: none !important;
}

/* Продавцу: заявки клиентов — красный пульс, важнее «новых объявлений» */
.nav-bazaar-badge.is-clients {
  background: #f85149;
  animation: rf4-bazaar-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes rf4-bazaar-badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px var(--rf4-bg-elevated, var(--rf4-bg)); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 2px var(--rf4-bg-elevated, var(--rf4-bg)), 0 0 0 5px rgba(248, 81, 73, 0.28); }
}

.nav-item-bazaar.has-bazaar-news .nav-label {
  color: #f0883e;
}

.nav-item-bazaar.has-bazaar-clients {
  border-color: rgba(248, 81, 73, 0.55);
  background: rgba(248, 81, 73, 0.12);
}

.nav-item-bazaar.has-bazaar-clients .nav-label {
  color: #ff7b72;
  font-weight: 700;
}

html[data-theme="light"] .nav-item-bazaar {
  color: #9a6700;
  background: rgba(154, 103, 0, 0.08);
  border-color: rgba(154, 103, 0, 0.28);
}

html[data-theme="light"] .nav-item-bazaar .nav-label {
  color: #9a6700;
}

html[data-theme="light"] .nav-item-bazaar:hover,
html[data-theme="light"] .nav-item-bazaar.active {
  background: rgba(154, 103, 0, 0.14);
  border-color: rgba(154, 103, 0, 0.45);
}

html[data-theme="light"] .nav-item-bazaar:hover .nav-label,
html[data-theme="light"] .nav-item-bazaar.active .nav-label {
  color: #7d5200;
}

html[data-theme="light"] .nav-bazaar-badge {
  background: #bf4b00;
  box-shadow: 0 0 0 2px var(--rf4-bg-elevated, #fff);
}

html[data-theme="light"] .nav-bazaar-badge.is-clients {
  background: #cf222e;
}

html[data-theme="light"] .nav-item-bazaar.has-bazaar-news .nav-label {
  color: #bf4b00;
}

html[data-theme="light"] .nav-item-bazaar.has-bazaar-clients {
  border-color: rgba(207, 34, 46, 0.45);
  background: rgba(207, 34, 46, 0.1);
}

html[data-theme="light"] .nav-item-bazaar.has-bazaar-clients .nav-label {
  color: #cf222e;
}

.nav-item-admin.has-pending-submissions .nav-label {
  color: var(--rf4-accent);
}

.nav-admin-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: #f85149;
  border-radius: 9px;
  box-shadow: 0 0 0 2px var(--rf4-bg);
}

.nav-item-admin .nav-icon {
  filter: none;
}

.nav-item-admin:hover .nav-label,
.nav-item-admin.active .nav-label {
  color: #ffa657;
}

/* --------------------------------------------
   5) TABS & MAIN
   -------------------------------------------- */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  overflow: hidden;
}

.tab-panel {
  display: none;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
}

#panelMain {
  width: 100%;
  min-width: 0;
}

#panelMain .detail-section {
  width: 100%;
  min-width: 0;
}

.tab-content-inner {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  padding-bottom: calc(1rem + 5px);
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.tab-page-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.tab-content-trophies {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.encyclopedia-head {
  flex-shrink: 0;
}

.encyclopedia-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.encyclopedia-layout-list-only .trophies-table-wrap {
  flex: 1;
}

/* z-index задаётся в секции MODALS (.modal.encyclopedia-fish-modal), чтобы не перебивался правилом .modal */

.encyclopedia-fish-modal-content {
  width: min(920px, 96vw);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  border: 1px solid #3d444d;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.encyclopedia-fish-modal.encyclopedia-fish-modal--tabs .encyclopedia-fish-modal-content {
  width: min(980px, 96vw);
}

.encyclopedia-fish-modal-content .modal-close-btn {
  z-index: 50;
  top: 0.55rem;
  right: 0.55rem;
  background: var(--rf4-bg-muted);
  box-shadow: 0 0 0 3px var(--rf4-bg-elevated), 0 2px 10px rgba(0, 0, 0, 0.45);
}

.encyclopedia-fish-modal-body {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  font-size: 0.9rem;
}

body.encyclopedia-modal-open {
  overflow: hidden;
}

.efm {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.efm-hero {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 3.75rem 1rem 1.35rem;
  background: linear-gradient(135deg, #1a2332 0%, var(--rf4-bg-elevated) 55%, var(--rf4-bg) 100%);
  border-bottom: 1px solid var(--rf4-border);
  flex-shrink: 0;
}

.efm-hero-top {
  display: grid;
  grid-template-columns: minmax(150px, 32%) minmax(0, 1fr);
  gap: 1rem 1.15rem;
  align-items: start;
  width: 100%;
}

.efm-hero-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.efm-hero-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  justify-content: flex-start;
}

.efm-hero-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.65rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.06);
}

.efm-hero-rarity-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  z-index: 2;
}

.efm-hero-img {
  max-width: 100%;
  max-height: min(36vh, 260px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

.efm-hero-placeholder {
  font-size: 3rem;
  opacity: 0.35;
}

.efm-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.7rem;
  background: var(--rf4-bg-muted);
  border: 1px solid #3fb950;
  color: #3fb950;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}

.efm-action-btn:hover {
  background: rgba(63, 185, 80, 0.12);
}

.efm-hero-info {
  min-width: 0;
  flex-shrink: 0;
}

.efm-hero-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  min-width: 0;
  padding-right: 2rem;
}

.efm-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.25;
  flex: 0 1 auto;
  min-width: 0;
}

.efm-rarity {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rf4-text);
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.efm-cross-links-host {
  margin-top: 0.15rem;
}

.efm-cross-links-host .rf4-cross-links {
  margin: 0;
}

.rf4-icon-dual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
  position: relative;
}

.rf4-icon-dual-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rf4-icon-dual-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--rf4-text);
}

.rf4-icon-dual-fallback svg {
  width: 100%;
  height: 100%;
  display: block;
}

.rf4-icon-dual-fallback[hidden] {
  display: none !important;
}

.rf4-icon-dual.is-fallback .rf4-icon-dual-fallback,
.rf4-icon-dual:not(:has(.rf4-icon-dual-img)) .rf4-icon-dual-fallback {
  display: inline-flex;
}

.efm-rarity-icon.rf4-icon-dual {
  width: 18px;
  height: 18px;
}

.efw-trophy-icon.rf4-icon-dual {
  width: 34px;
  height: 34px;
}

.efw-trophy--trophy .rf4-icon-dual-fallback {
  color: #e3b341;
}

.efw-trophy--rare .rf4-icon-dual-fallback {
  color: var(--rf4-accent);
}

.efm-rarity-rare_species .rf4-icon-dual-fallback {
  color: #d2a8ff;
}

.rf4-cross-link-icon.rf4-icon-dual {
  width: 16px;
  height: 16px;
}

.rf4-cross-link-icon.rf4-icon-dual .rf4-icon-dual-fallback {
  color: var(--rf4-text-soft);
}

.efm-rarity-rare_species {
  background: rgba(163, 113, 247, 0.15);
  border-color: rgba(163, 113, 247, 0.45);
  color: #d2a8ff;
}

.efm-rarity-icon {
  width: 18px;
  height: auto;
  max-height: 22px;
  object-fit: contain;
}

.efm-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* —— Полоска порогов под фото —— */
.efw-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  width: 100%;
}

.efw-strip-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.38rem 0.25rem;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.65);
  border: 1px solid rgba(48, 54, 61, 0.7);
  text-align: center;
}

.efw-strip-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.efw-strip-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.15;
  white-space: nowrap;
}

.efw-strip-item--credit {
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.07);
}

.efw-strip-item--credit .efw-strip-value {
  color: #7ee787;
}

.efw-strip-item--chat {
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.07);
}

.efw-strip-item--chat .efw-strip-value {
  color: var(--rf4-accent);
}

/* —— Трофеи справа от фото —— */
.efw-hero-trophies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.efw-hero-trophies .efw-trophy {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.7rem 0.45rem 0.6rem;
  min-height: 88px;
}

.efw-hero-trophies .efw-trophy-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 0.2rem;
}

.efw-hero-trophies .efw-trophy-value {
  font-size: 1.2rem;
}

.efw-bait--hero {
  margin-top: 0;
  font-size: 0.78rem;
  padding: 0.38rem 0.5rem;
}

.efm-weights-empty--hero {
  padding: 0.55rem 0.65rem;
  font-size: 0.78rem;
}

/* —— Веса в карточке (полный блок) —— */
.efm-weights {
  margin: 0;
}

.efm-points-block {
  order: -1;
}

.efm-baits-stats-block {
  order: -0.5;
}

.efm-block-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--rf4-text-muted);
}

.efm-baits-stats-meta,
.efm-baits-stats-best {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

.efm-baits-stats-best strong {
  color: var(--rf4-text);
}

.efm-baits-stats-bars .analytics-bait-row {
  font-size: 0.82rem;
}

.efm-cross-links-host {
  margin-top: 0.55rem;
}

.rf4-cross-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.rf4-cross-links--toolbar {
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.rf4-cross-links--compact {
  margin-top: 0.25rem;
}

.rf4-cross-link-btn {
  flex-shrink: 0;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-accent);
  color: var(--rf4-accent);
  border-radius: 8px;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
  line-height: 1.3;
}

.rf4-cross-link-btn--icon {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  line-height: 1;
  border-color: var(--rf4-border);
  background: rgba(33, 38, 45, 0.9);
}

.rf4-cross-link-btn--icon .rf4-cross-link-icon.rf4-icon-dual {
  display: inline-flex;
  width: 16px;
  height: 16px;
  transform: translateY(0.02rem);
  opacity: 0.92;
  pointer-events: none;
}

.rf4-cross-link-btn--icon .rf4-cross-link-icon-img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.92;
  pointer-events: none;
}

.rf4-cross-link-btn--icon .rf4-cross-link-icon {
  display: block;
  transform: translateY(0.02rem);
}

.rf4-cross-link-btn--icon .rf4-cross-link-text {
  margin-left: 0.25rem;
  font-size: 0.68rem;
}

.rf4-cross-link-btn:hover,
.rf4-cross-link-btn--icon:hover {
  background: rgba(56, 139, 253, 0.15);
  border-color: var(--rf4-accent);
}

.rec-fish-hub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}

.rec-fish-hub-name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 11rem;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--rf4-text);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-fish-hub-actions {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.rec-td-fish-hub {
  padding: 0.4rem 0.35rem !important;
  min-width: 10.5rem;
  vertical-align: middle;
}

.rec-fish-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.rec-fish-name {
  font-weight: 500;
}

.rec-td-location-link {
  color: var(--rf4-accent);
  cursor: pointer;
}

.rec-td-location-link:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .efm-hero-top {
    grid-template-columns: 1fr;
  }

  .efw-strip {
    flex-wrap: wrap;
  }

  .efw-strip-item {
    flex: 1 1 calc(25% - 0.35rem);
    min-width: 4.2rem;
  }

  .efm-hero-img {
    max-height: min(32vh, 220px);
  }
}

.efm-weights-empty {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-elevated);
  border: 1px dashed var(--rf4-border);
  border-radius: 10px;
  line-height: 1.5;
}

.efm-weights-empty code {
  font-size: 0.75rem;
  color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.efw-panel {
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  padding: 0.85rem;
}

.efw-trophies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.efw-trophy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem 0.5rem 0.65rem;
  border-radius: 12px;
  border: 2px solid transparent;
}

.efw-trophy-body {
  min-width: 0;
}

.efw-trophy--trophy {
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.14) 0%, rgba(210, 153, 34, 0.04) 100%);
  border-color: rgba(227, 179, 65, 0.55);
}

.efw-trophy--rare {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.14) 0%, rgba(56, 189, 248, 0.04) 100%);
  border-color: rgba(121, 192, 255, 0.5);
}

.efw-trophy-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.efw-trophy-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.efw-trophy--trophy .efw-trophy-tag {
  color: #e3b341;
}

.efw-trophy--rare .efw-trophy-tag {
  color: var(--rf4-accent);
}

.efw-trophy-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--rf4-text);
  letter-spacing: -0.02em;
}

.efw-trophy--trophy .efw-trophy-value {
  color: #f0d675;
}

.efw-trophy--rare .efw-trophy-value {
  color: #9ecaff;
}

.efw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rf4-border);
}

.efw-grid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.efw-grid-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.efw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--rf4-text-muted);
}

.efw-grid-row--credit .efw-dot { background: #3fb950; }
.efw-grid-row--chat .efw-dot { background: var(--rf4-accent); }
.efw-grid-row--max .efw-dot { background: var(--rf4-text-muted); }

.efw-grid-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--rf4-text);
  text-align: right;
  white-space: nowrap;
}

.efw-bait {
  margin-top: 0.65rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  color: #3fb950;
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.efw-bait-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.efm-waters-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--rf4-text-soft);
}

.efm-waters-sep {
  color: var(--rf4-border);
  user-select: none;
}

.efm-water-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--rf4-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.efm-water-link:hover {
  color: var(--rf4-accent);
}

.efm-water-name {
  color: var(--rf4-text);
}

.encyclopedia-bait-mark {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin-left: 0.25em;
  vertical-align: -0.25em;
  object-fit: contain;
  opacity: 0.95;
}

.encyclopedia-bait-mark--fallback {
  font-size: 1.15em;
  line-height: 1;
}

.efm-stat {
  flex: 1 1 100px;
  padding: 0.5rem 0.65rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.efm-stat-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rf4-text-muted);
  margin-bottom: 0.15rem;
}

.efm-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rf4-accent);
}

.efm-stat-value-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.efm-stat-weight-icon {
  width: auto;
  height: 22px;
  max-width: 24px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.efm-body {
  padding: 1rem 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.efm-block-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rf4-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.efm-rigs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.efm-rig {
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.efm-rig-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--rf4-accent);
  margin-bottom: 0.35rem;
}

.efm-rig-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--rf4-text-soft);
}

.efm-rig-list li {
  margin-bottom: 0.2rem;
}

.efm-loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.5rem;
}

.efm-loc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem;
  text-align: left;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  color: var(--rf4-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font: inherit;
  font-size: 0.82rem;
}

.efm-loc-card:hover {
  border-color: var(--rf4-accent);
  background: var(--rf4-bg-muted);
  transform: translateY(-1px);
}

.efm-loc-card.is-yes {
  border-color: rgba(35, 134, 54, 0.55);
  background: rgba(35, 134, 54, 0.08);
}

.efm-loc-card.is-medal {
  border-color: rgba(210, 153, 34, 0.55);
  background: rgba(210, 153, 34, 0.08);
}

.efm-loc-card.is-max {
  border-color: rgba(88, 166, 255, 0.55);
  background: rgba(88, 166, 255, 0.1);
}

.efm-loc-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
}

.efm-trophy-icon {
  width: auto;
  height: 22px;
  max-width: 26px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.efm-loc-check {
  font-size: 0.85rem;
  color: #3fb950;
}

.efm-loc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
}

.efm-loc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.td-thumb img {
  width: 44px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.encyclopedia-rarity-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0.25rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.encyclopedia-rarity-text {
  vertical-align: middle;
}

.td-rarity {
  white-space: nowrap;
}

.encyclopedia-row--rare_species .td-name {
  color: #d2a8ff;
}

.efm-loc-badge-txt {
  font-size: 0.85rem;
  line-height: 1;
}

.efm-loc-empty {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.efm-points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.efm-point-card {
  padding: 0.65rem 0.75rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.efm-point-card:hover {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.25);
}

.efm-point-coords {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rf4-accent);
  margin-bottom: 0.2rem;
}

.efm-point-loc {
  font-size: 0.78rem;
  color: var(--rf4-text-soft);
  margin-bottom: 0.25rem;
}

.efm-point-meta {
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.35rem;
}

.efm-point-snippet {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.efm-points-loading,
.efm-points-empty {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--rf4-bg-muted);
  border: 1px dashed var(--rf4-border);
  border-radius: 10px;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.efm-weight-threshold-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(56, 139, 253, 0.08);
  border: 1px solid rgba(56, 139, 253, 0.22);
  border-radius: 8px;
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.efm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.efm-pill {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
}

.efm-pill strong {
  color: var(--rf4-text-muted);
  font-weight: 500;
  margin-right: 0.25rem;
}

.efm-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.efm-card {
  padding: 0.85rem 1rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
}

.efm-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rf4-text-muted);
}

.efm-tips-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--rf4-text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.efm-tips-list li + li {
  margin-top: 0.4rem;
}

.efm-about {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--rf4-text-soft);
}

/* Вкладки карточки рыбы */
.efm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.55rem 3.75rem 0 1.15rem;
  background: var(--rf4-bg-elevated);
  border-bottom: 1px solid var(--rf4-border);
  flex-shrink: 0;
}

.efm-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.efm-tab:hover {
  color: var(--rf4-text-soft);
  background: rgba(88, 166, 255, 0.06);
}

.efm-tab.is-active {
  color: var(--rf4-text);
  background: var(--rf4-bg);
  border-color: var(--rf4-border);
  box-shadow: inset 0 2px 0 var(--rf4-accent);
}

.efm-tab-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.efm-tab-badge {
  display: inline-flex;
  align-items: center;
  min-width: 1.35rem;
  padding: 0.08rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(63, 185, 80, 0.16);
  color: #7ee787;
  border: 1px solid rgba(63, 185, 80, 0.28);
}

.efm-tab-panels {
  background: var(--rf4-bg);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.encyclopedia-fish-modal:not(.encyclopedia-fish-modal--tabs) .efm-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.efm-tab-panel {
  display: none;
}

.efm-tab-panel.is-active {
  display: block;
}

.efm-tab-panel .efm-body {
  padding: 1rem 1.25rem 1.35rem;
}

.efm-body--economy {
  padding-top: 0.85rem;
}

.efm-economy-groups {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.efm-economy-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.efm-economy-group--trophy {
  padding-top: 0.15rem;
  border-top: 1px solid rgba(88, 166, 255, 0.2);
}

.efm-economy-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
}

.efm-economy-card--credit {
  border-color: rgba(139, 148, 158, 0.45);
}

.efm-economy-card--trophy {
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.05);
}

.efm-economy-card--rare_trophy {
  border-color: rgba(227, 179, 65, 0.4);
  background: rgba(227, 179, 65, 0.06);
}

.efm-economy-card--blue {
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.07);
}

.efm-economy-rank {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--rf4-text);
  margin-bottom: 0.55rem;
}

.efm-economy-metrics {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.efm-economy-metrics > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.efm-economy-metrics dt {
  margin: 0;
  color: var(--rf4-text-muted);
  font-weight: 500;
}

.efm-economy-metrics dd {
  margin: 0;
  color: var(--rf4-text);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 720px) {
  .efm-economy-group {
    grid-template-columns: 1fr;
  }
}

/* Прикормки — таблица */
.gb-panel {
  padding: 1rem 1.15rem 1.25rem;
  min-height: 220px;
}

.gb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.gb-search-wrap {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gb-search-wrap:focus-within {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15);
}

.gb-search-icon {
  font-size: 0.85rem;
  opacity: 0.65;
  flex-shrink: 0;
}

.gb-search {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--rf4-text);
  font-size: 0.85rem;
  outline: none;
}

.gb-search::placeholder {
  color: var(--rf4-text-muted);
}

.gb-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.gb-stat strong {
  color: var(--rf4-text-soft);
  font-weight: 600;
}

.gb-source {
  color: var(--rf4-accent);
  text-decoration: none;
  white-space: nowrap;
}

.gb-source:hover {
  text-decoration: underline;
}

.gb-table-wrap {
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow: auto;
  max-height: min(52vh, 420px);
  background: var(--rf4-bg-elevated);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.gb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.gb-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.gb-table th {
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border-bottom: 1px solid var(--rf4-border);
}

.gb-th-num {
  width: 3rem;
  text-align: center !important;
}

.gb-table tbody tr {
  border-bottom: 1px solid rgba(48, 54, 61, 0.65);
  transition: background 0.12s;
}

.gb-table tbody tr:nth-child(even) {
  background: rgba(13, 17, 23, 0.45);
}

.gb-table tbody tr:hover {
  background: rgba(56, 139, 253, 0.08);
}

.gb-table td {
  padding: 0.65rem 0.75rem;
  vertical-align: top;
  color: var(--rf4-text-soft);
}

.gb-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--rf4-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.gb-recipe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gb-chip {
  display: inline-block;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1.35;
  background: linear-gradient(180deg, rgba(56, 139, 253, 0.14) 0%, rgba(56, 139, 253, 0.08) 100%);
  border: 1px solid rgba(56, 139, 253, 0.22);
  color: var(--rf4-text-soft);
}

.gb-table tbody tr:nth-child(3n+2) .gb-chip {
  background: linear-gradient(180deg, rgba(63, 185, 80, 0.14) 0%, rgba(63, 185, 80, 0.07) 100%);
  border-color: rgba(63, 185, 80, 0.22);
}

.gb-table tbody tr:nth-child(3n) .gb-chip {
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.14) 0%, rgba(210, 153, 34, 0.07) 100%);
  border-color: rgba(210, 153, 34, 0.24);
}

.gb-recipe-full {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}

.gb-filter-empty {
  margin: 0.75rem 0 0;
}

.gb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 180px;
  color: var(--rf4-text-muted);
  text-align: center;
}

.gb-empty-icon {
  font-size: 2rem;
  opacity: 0.7;
}

.gb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 180px;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.gb-loading-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--rf4-border);
  border-top-color: var(--rf4-accent);
  border-radius: 50%;
  animation: gb-spin 0.7s linear infinite;
}

@keyframes gb-spin {
  to { transform: rotate(360deg); }
}

.efm-details {
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  overflow: hidden;
}

.efm-details summary {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  user-select: none;
}

.efm-details-inner {
  padding: 0.85rem;
  border-top: 1px solid var(--rf4-border);
}

.encyclopedia-modal-hero {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
}

.encyclopedia-modal-hero-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: min(42vh, 320px);
  margin: 0 auto 1rem;
  padding: 0.5rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
}

.encyclopedia-modal-hero-img {
  max-width: 100%;
  max-height: min(40vh, 300px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.encyclopedia-modal-hero-img-wrap.is-empty {
  min-height: 120px;
  color: var(--rf4-border);
  font-size: 3rem;
}

.encyclopedia-detail-header {
  margin-bottom: 0;
}

.encyclopedia-detail-img {
  display: none;
}

.encyclopedia-detail-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--rf4-text);
  line-height: 1.3;
}

#encyclopediaFishModalTitle.encyclopedia-detail-title {
  margin-right: 2rem;
}

.encyclopedia-detail-rarity {
  margin: 0.25rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
}

.encyclopedia-detail-section {
  margin-bottom: 1rem;
}

.encyclopedia-detail-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rf4-text-muted);
  font-weight: 600;
}

.encyclopedia-detail-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.encyclopedia-detail-kv dt {
  color: var(--rf4-text-muted);
  margin: 0;
}

.encyclopedia-detail-kv dd {
  margin: 0;
  color: var(--rf4-text);
}

.encyclopedia-detail-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--rf4-text);
}

.encyclopedia-detail-tiers {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.encyclopedia-detail-tiers th,
.encyclopedia-detail-tiers td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  text-align: left;
}

.encyclopedia-detail-tiers th {
  color: var(--rf4-text-muted);
  font-weight: 500;
}

.encyclopedia-detail-locs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.encyclopedia-loc-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
}

.encyclopedia-loc-chip.is-yes {
  border-color: #238636;
  color: #3fb950;
}

.encyclopedia-loc-chip.is-medal {
  border-color: #d29922;
  color: #e3b341;
}

.encyclopedia-loc-chip.is-max {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.encyclopedia-detail-note {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.encyclopedia-tips-list li {
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.encyclopedia-tips-disclaimer {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
  font-style: italic;
}

.encyclopedia-table .trophies-row {
  cursor: pointer;
}

.encyclopedia-table .trophies-row.selected {
  background: rgba(56, 139, 253, 0.12);
}

.encyclopedia-table .trophies-row.has-detail .td-name::after {
  content: " •";
  color: var(--rf4-accent);
  font-weight: bold;
}

.encyclopedia-gb-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.35rem;
  padding: 0.08rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.25);
  color: #7ee787;
  vertical-align: middle;
  white-space: nowrap;
}

.th-thumb {
  width: 52px;
}

.td-thumb img {
  width: 44px;
  height: 30px;
  object-fit: contain;
  display: block;
}

@media (max-width: 720px) {
  .efm-hero-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .efm-hero-headline {
    justify-content: center;
    padding-right: 0;
  }
  .efm-columns {
    grid-template-columns: 1fr;
  }
  .efm-loc-grid {
    grid-template-columns: 1fr 1fr;
  }
  .efm-tabs {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    overflow-x: auto;
  }
  .efm-tab {
    flex-shrink: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .gb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .gb-toolbar-meta {
    justify-content: space-between;
  }
  .gb-table-wrap {
    max-height: min(48vh, 360px);
  }
}

.tab-content-inner.tab-content-records {
  overflow: hidden;
}

.tab-content-records {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tab-content-reels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.tab-content-rods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.tab-content-hooks {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.hooks-hint {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.88rem;
}

.hooks-fish-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(56, 139, 253, 0.1);
  border: 1px solid rgba(56, 139, 253, 0.35);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--rf4-text-soft);
}

.hooks-fish-filter-text {
  flex: 1 1 12rem;
}

.hooks-fish-filter-clear {
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.hooks-fish-filter-clear:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.hooks-th-size--match,
.hooks-td-weight--match {
  background: rgba(63, 185, 80, 0.12);
}

.hooks-filters-block {
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.hooks-filters-block-title {
  font-weight: 700;
  color: var(--rf4-text-soft);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.hooks-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.hooks-filter-label {
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.hooks-filter-select,
.hooks-filter-input {
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
}

.hooks-search-name {
  min-width: 12rem;
}

.hooks-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.hooks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.hooks-table th,
.hooks-table td {
  padding: 0.4rem 0.45rem;
  text-align: center;
  border-bottom: 1px solid var(--rf4-bg-muted);
  white-space: nowrap;
}

.hooks-table th.hooks-th-name,
.hooks-table td.hooks-td-name,
.hooks-table th.hooks-th-type,
.hooks-table td.hooks-td-type {
  text-align: left;
  position: sticky;
  z-index: 3;
  background: var(--rf4-bg-elevated);
}

.hooks-table th.hooks-th-name,
.hooks-table td.hooks-td-name {
  left: 0;
  min-width: 10rem;
  max-width: 14rem;
}

.hooks-table th.hooks-th-type,
.hooks-table td.hooks-td-type {
  left: 10rem;
  min-width: 7rem;
  max-width: 10rem;
}

.hooks-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 600;
}

.hooks-td-name {
  font-weight: 500;
  color: var(--rf4-text);
}

.hooks-td-weight {
  color: var(--rf4-text-soft);
  font-variant-numeric: tabular-nums;
  cursor: crosshair;
}

.hooks-table th.hooks-col-hover,
.hooks-table td.hooks-col-hover {
  background: rgba(63, 185, 80, 0.14) !important;
}

.hooks-table tr.hooks-row-hover td {
  background: rgba(63, 185, 80, 0.14) !important;
}

.hooks-table tr.hooks-row-hover td.hooks-td-name,
.hooks-table tr.hooks-row-hover td.hooks-td-type {
  background: rgba(63, 185, 80, 0.2) !important;
}

.hooks-table td.hooks-cell-hover {
  background: rgba(63, 185, 80, 0.38) !important;
  box-shadow: inset 0 0 0 1px rgba(63, 185, 80, 0.75);
  color: var(--rf4-text);
}

.hooks-table tbody tr:hover td:not(.hooks-cell-hover):not(.hooks-col-hover):not(.hooks-td-name):not(.hooks-td-type) {
  background: var(--rf4-bg-muted);
}

.hooks-table tbody tr.hooks-row-hover:hover td.hooks-cell-hover {
  background: rgba(63, 185, 80, 0.38) !important;
}

.hooks-empty {
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------
   Cafe (Кафе РР4)
   -------------------------------------------- */
.tab-content-cafe {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  position: relative;
}
.tab-content-cafe .tab-page-title {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--rf4-text);
}
.cafe-status-line {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}
.cafe-layout-wrap {
  display: flex;
  gap: 1.25rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cafe-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--rf4-bg-elevated);
  border-radius: 10px;
  padding: 14px 12px;
  border: 1px solid var(--rf4-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cafe-sidebar-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--rf4-text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rf4-border);
}
.cafe-wb-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.cafe-wb-btn {
  padding: 10px 12px;
  text-align: left;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  transition: background 0.15s, color 0.15s;
}
.cafe-wb-btn:hover {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
}
.cafe-wb-btn.active {
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  color: #fff;
  font-weight: 500;
}
.cafe-main {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 2px;
}
.cafe-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.cafe-card {
  position: relative;
  background: linear-gradient(180deg, var(--rf4-bg-elevated) 0%, var(--rf4-bg) 100%);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cafe-card:hover {
  border-color: var(--rf4-accent);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}
.cafe-card-img {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg);
  padding: 12px;
}
.cafe-card-img img {
  max-height: 128px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}
.cafe-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.cafe-card .fish-name {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0;
  color: var(--rf4-text);
  line-height: 1.25;
}
.cafe-card .fish-wb {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  margin: 0;
}
.cafe-card .fish-timer {
  margin: 6px 0 2px;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}
.cafe-timer-value {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
}
.cafe-timer-value.cafe-timer-ok {
  background: rgba(35, 134, 54, 0.25);
  color: #3fb950;
}
.cafe-timer-value.cafe-timer-expiring {
  background: rgba(248, 81, 73, 0.25);
  color: #f85149;
  animation: cafe-pulse 1.5s ease-in-out infinite;
}
@keyframes cafe-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}
.cafe-card .fish-details {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}
.cafe-card .fish-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rf4-accent);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--rf4-bg-muted);
}
.cafe-card-add-task {
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-accent);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.cafe-card-add-task:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}
.cafe-no-data {
  padding: 48px 24px;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 1rem;
  line-height: 1.5;
}
.cafe-no-data-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.7;
}
.cafe-no-data-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text, #333);
}
.cafe-sync-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}
.cafe-sync-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--rf4-loading-scrim);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.cafe-sync-overlay .rf4-fishing-loader-host {
  min-height: 100%;
  width: 100%;
}

.cafe-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.cafe-topbar-title {
  margin: 0;
}
.cafe-watch-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.cafe-watch-open-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.25);
}
.cafe-watch-open-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #238636;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.cafe-watch-modal-content {
  width: min(1120px, 96vw);
  height: min(84vh, 820px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.35rem 1.15rem;
  overflow: hidden;
  box-sizing: border-box;
}
.cafe-watch-add-modal-content {
  width: min(440px, 96vw);
  min-width: min(320px, 96vw);
  max-height: min(92vh, 720px);
  padding: 1.15rem 1.25rem 1.2rem;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.cafe-watch-add-modal {
  align-items: center;
  justify-content: center;
}
.cafe-watch-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}
.cafe-watch-add-modal .cafe-watch-modal-toolbar {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rf4-border);
}
.cafe-watch-add-modal .cafe-watch-add-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.cafe-watch-add-modal .cafe-watch-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0;
}
.cafe-watch-add-modal .cafe-watch-select,
.cafe-watch-add-modal .cafe-watch-fish-trigger {
  min-height: 2.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  box-shadow: 0 1px 2px var(--rf4-shadow);
}
.cafe-watch-add-modal .cafe-watch-fish-trigger:not(:disabled):hover,
.cafe-watch-add-modal .cafe-watch-select:hover {
  border-color: var(--rf4-accent);
}
.cafe-watch-add-modal .cafe-watch-fish-dropdown {
  width: 100%;
  z-index: 5;
}
.cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-list {
  max-height: min(320px, 48vh);
  margin-top: 4px;
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  z-index: 40;
  overflow-y: auto;
}
.cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-option {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--rf4-text);
}
.cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-option:hover,
.cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-option:focus {
  background: var(--rf4-accent-soft);
  color: var(--rf4-accent);
}
.cafe-watch-add-modal .cafe-watch-add-notify {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 12px;
  border-color: var(--rf4-border);
}
.cafe-watch-add-modal .cafe-watch-check--chip {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--rf4-text);
}
.cafe-watch-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cafe-watch-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rf4-text);
}
.cafe-watch-header-add-btn {
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2ea043 0%, #238636 100%);
  border: 1px solid #2ea043;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.cafe-watch-header-add-btn:hover {
  filter: brightness(1.06);
}
.cafe-watch-toolbar-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.cafe-watch-toolbar-close:hover {
  color: var(--rf4-text);
  border-color: var(--rf4-border);
}
.cafe-watch-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}
.cafe-watch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  padding: 2px 4px 8px 0;
}
.cafe-watch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--rf4-bg-elevated) 0%, var(--rf4-bg) 100%);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cafe-watch-card:hover {
  border-color: var(--rf4-border);
}
.cafe-watch-card--live {
  border-color: var(--rf4-accent);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}
.cafe-watch-card-img {
  position: relative;
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-bg);
  padding: 10px;
}
.cafe-watch-card-img img {
  max-height: 108px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}
.cafe-watch-card-noimg {
  font-size: 2rem;
  opacity: 0.35;
}
.cafe-watch-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.cafe-watch-card-fish {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--rf4-text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cafe-watch-card-wb {
  font-size: 0.74rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cafe-watch-card-timer {
  margin: 4px 0 2px;
}
.cafe-watch-live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--rf4-accent);
  background: rgba(13, 17, 23, 0.82);
  border: 1px solid rgba(88, 166, 255, 0.45);
  backdrop-filter: blur(4px);
}
.cafe-watch-card-toggles {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}
.cafe-watch-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-loading-scrim);
  color: var(--rf4-text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.cafe-watch-card-delete:hover {
  background: rgba(248, 81, 73, 0.15);
  border-color: rgba(248, 81, 73, 0.45);
  color: #f85149;
}
.cafe-watch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cafe-watch-toggle:hover {
  border-color: var(--rf4-border);
  color: var(--rf4-text-soft);
}
.cafe-watch-toggle.is-on.cafe-watch-toggle--appear {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.1);
}
.cafe-watch-toggle.is-on.cafe-watch-toggle--expire {
  color: #f0883e;
  border-color: rgba(240, 136, 62, 0.45);
  background: rgba(240, 136, 62, 0.1);
}
.cafe-watch-toggle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rf4-border);
}
.cafe-watch-toggle.is-on .cafe-watch-toggle-dot {
  background: currentColor;
}
.cafe-watch-goto-btn {
  width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
  color: var(--rf4-accent);
  cursor: pointer;
  line-height: 1.2;
}
.cafe-watch-goto-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}
.cafe-watch-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  min-height: 240px;
}
.cafe-watch-empty-state[hidden] {
  display: none !important;
}
.cafe-watch-empty-icon {
  font-size: 1.75rem;
  opacity: 0.5;
  margin-bottom: 0.4rem;
}
.cafe-watch-empty-title {
  margin: 0;
  font-size: 0.88rem;
  color: var(--rf4-text-muted);
}
.cafe-watch-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.cafe-watch-add-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cafe-watch-add-notify {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-bg-muted);
  border-radius: 10px;
  margin-bottom: 14px;
}
.cafe-watch-add-notify-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.cafe-watch-check--chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  margin: 0;
}
.cafe-watch-check--chip:has(input:checked) {
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.08);
  color: #3fb950;
}
@media (max-width: 520px) {
  .cafe-watch-add-grid {
    grid-template-columns: 1fr;
  }
  .cafe-watch-list {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }
}
.cafe-watch-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2ea043 0%, #238636 100%);
  border: 1px solid #2ea043;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.cafe-watch-primary-btn:hover {
  filter: brightness(1.06);
}
.cafe-watch-primary-btn--block {
  width: 100%;
}
.cafe-watch-secondary-btn {
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--rf4-text-soft);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  cursor: pointer;
}
.cafe-watch-secondary-btn:hover {
  background: var(--rf4-border);
}
.cafe-watch-add-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.cafe-watch-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cafe-watch-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--rf4-text-muted);
  margin-top: 2px;
}
.cafe-watch-select {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.88rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
}
.cafe-watch-fish-hint {
  margin: -2px 0 2px;
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}
.cafe-watch-fish-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 0.88rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
}
.cafe-watch-fish-search:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cafe-watch-fish-dropdown {
  width: 100%;
}
.cafe-watch-fish-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cafe-watch-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cafe-watch-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-bg-muted);
  border-radius: 10px;
}
.cafe-watch-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--rf4-text-soft);
  cursor: pointer;
}
.cafe-wb-btn--watched {
  border-color: var(--rf4-accent) !important;
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.35);
}
.cafe-card--watched {
  border-color: var(--rf4-accent) !important;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.35);
}
.cafe-card--watched-expire {
  border-color: #f0883e !important;
  box-shadow: 0 0 0 1px rgba(240, 136, 62, 0.45);
}
.cafe-card--alert-flash {
  animation: cafe-watch-flash 1.2s ease-in-out 3;
}
@keyframes cafe-watch-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 166, 255, 0); }
  50% { box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.55); }
}
.cafe-card-watch-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--rf4-border);
  border-radius: 50%;
  background: var(--rf4-loading-scrim);
  color: var(--rf4-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cafe-card-watch-btn:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}
.cafe-card-watch-btn.active {
  border-color: #f0883e;
  color: #f0883e;
  background: rgba(240, 136, 62, 0.12);
}

/* --------------------------------------------
   Analytics (Аналитика постов)
   -------------------------------------------- */
.tab-content-analytics {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 1.5rem;
}
.analytics-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
}
.analytics-loading {
  padding: 2rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 1rem;
}

/* —— Универсальный рыболовный лоадер —— */
.rf4-load-host {
  position: relative;
}
.rf4-load-host > .rf4-fishing-loader-host {
  display: none;
  width: 100%;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  min-height: 200px;
}
.rf4-load-host.rf4-host-loading > .rf4-fishing-loader-host {
  display: flex !important;
}
.rf4-load-host > .rf4-load-content[hidden] {
  display: none !important;
}
.analytics-fish-modal-content.rf4-host-loading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 280px;
}
.analytics-fish-modal-content.rf4-host-loading > .rf4-fishing-loader-host {
  flex: 1;
  min-height: 240px;
}
.analytics-fish-modal-main.rf4-host-loading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 260px;
}
.analytics-fish-modal-main.rf4-host-loading > .rf4-fishing-loader-host {
  flex: 1;
  min-height: 220px;
}
.rf4-fishing-loader-host {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  min-height: 180px;
}
.rf4-fishing-loader-host[hidden] {
  display: none !important;
}
.rf4-fishing-loader-host--overlay {
  min-height: 100%;
  width: 100%;
  padding: 2rem 1.25rem;
}
.rf4-fishing-loader-host--inline {
  min-height: 140px;
  padding: 1.25rem 0.75rem;
}
.rf4-fishing-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  text-align: center;
  width: max-content;
  max-width: 100%;
}
.rf4-fishing-loader--compact {
  gap: 0.65rem;
  transform: scale(0.88);
  transform-origin: center center;
}
.rf4-fishing-loader-scene {
  position: relative;
  width: 140px;
  height: 110px;
  margin: 0 auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}
.rf4-fishing-loader--compact .rf4-fishing-loader-scene {
  width: 110px;
  height: 88px;
}
.rf4-fishing-loader-water {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 32px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, rgba(35, 134, 197, 0.12) 0%, rgba(35, 134, 197, 0.42) 100%);
  box-shadow: inset 0 1px 0 rgba(88, 166, 255, 0.2);
  overflow: hidden;
}
.rf4-fishing-loader-water::after {
  content: "";
  position: absolute;
  left: -40%;
  right: -40%;
  top: 5px;
  height: 7px;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.28);
  animation: rf4-fishing-wave 2.4s ease-in-out infinite;
}
.rf4-fishing-loader-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 54px;
  margin-left: -1px;
  background: linear-gradient(180deg, var(--rf4-text-muted) 0%, var(--rf4-text-soft) 70%, var(--rf4-accent) 100%);
  transform-origin: top center;
  animation: rf4-fishing-line-sway 2.2s ease-in-out infinite;
}
.rf4-fishing-loader-bobber {
  position: absolute;
  left: 50%;
  top: 46px;
  width: 24px;
  margin-left: -12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rf4-fishing-bobber-bob 1.6s ease-in-out infinite;
}
.rf4-fishing-loader-bobber-cap {
  width: 15px;
  height: 8px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #f85149 0%, #e5534b 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.rf4-fishing-loader-bobber-body {
  width: 20px;
  height: 24px;
  margin-top: -1px;
  border-radius: 4px 4px 10px 10px;
  background: linear-gradient(180deg, var(--rf4-text) 0%, var(--rf4-text) 44%, #e5534b 45%, #c93c37 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}
.rf4-fishing-loader-ripple {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 14px;
  height: 7px;
  margin-left: -7px;
  border: 2px solid rgba(88, 166, 255, 0.55);
  border-radius: 50%;
  opacity: 0;
  animation: rf4-fishing-ripple 2s ease-out infinite;
}
.rf4-fishing-loader-ripple-2 {
  animation-delay: 1s;
}
.rf4-fishing-loader-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--rf4-text-muted);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.rf4-table-loading-row td {
  padding: 2.5rem 1rem !important;
  text-align: center !important;
  vertical-align: middle !important;
  border: none !important;
  background: transparent !important;
}
.rf4-table-loading-row .rf4-fishing-loader {
  margin-left: auto;
  margin-right: auto;
}
@keyframes rf4-fishing-bobber-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  35% { transform: translateY(-7px) rotate(2deg); }
  55% { transform: translateY(2px) rotate(-1deg); }
  70% { transform: translateY(-4px) rotate(1deg); }
}
@keyframes rf4-fishing-line-sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes rf4-fishing-wave {
  0%, 100% { transform: translateX(-8%); }
  50% { transform: translateX(8%); }
}
@keyframes rf4-fishing-ripple {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}

.analytics-error {
  padding: 1.5rem;
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid #f85149;
  border-radius: 10px;
  color: #f85149;
  font-size: 0.95rem;
}
.analytics-section {
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
}
.analytics-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rf4-border);
}
.analytics-summary .analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}
.analytics-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--rf4-bg) 0%, var(--rf4-bg-elevated) 100%);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  padding: 1rem 1.1rem 0.95rem;
  min-width: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.analytics-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--rf4-accent), #3fb950);
  opacity: 0.85;
}
.analytics-card-accent-gold::before {
  background: linear-gradient(90deg, #f0c14b, #e3a008);
}
.analytics-card-accent-green::before {
  background: linear-gradient(90deg, #3fb950, #238636);
}
.analytics-card-accent-violet::before {
  background: linear-gradient(90deg, #a371f7, #8957e5);
}
.analytics-card-icon {
  display: block;
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 0.55rem;
  opacity: 0.9;
}
.analytics-card-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--rf4-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.analytics-card-value.is-text {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-card-label {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.analytics-table-wrap {
  overflow-x: auto;
}
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.analytics-table th,
.analytics-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
}
.analytics-table th {
  color: var(--rf4-text-muted);
  font-weight: 600;
}
.analytics-table td {
  color: var(--rf4-text);
}
.analytics-chart-bar-wrap {
  max-height: 320px;
  overflow-y: auto;
}
.analytics-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.analytics-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.analytics-bar-label {
  min-width: 60px;
  color: var(--rf4-text-muted);
}
.analytics-bar-track {
  flex: 1;
  min-width: 0;
  height: 20px;
  background: var(--rf4-bg-muted);
  border-radius: 4px;
  overflow: hidden;
}
.analytics-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #238636, var(--rf4-accent));
  border-radius: 4px;
  transition: width 0.3s;
  min-width: 2px;
}
.analytics-bar-value {
  min-width: 2.5em;
  font-variant-numeric: tabular-nums;
  color: var(--rf4-text-soft);
  font-weight: 600;
}
.analytics-no-chart {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

.analytics-calendar-section { order: 0; }
.analytics-calendar-section .analytics-calendar-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}
.analytics-3months-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.analytics-3months {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  align-items: flex-start;
}
.analytics-month-block {
  background: var(--rf4-bg);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--rf4-border);
  min-width: 140px;
}
.analytics-month-block:first-child { order: 1; }
.analytics-month-block:last-child { order: 3; }
.analytics-month-block:nth-child(2) { order: 2; flex-shrink: 0; box-shadow: 0 0 0 2px var(--rf4-accent); }
.analytics-month-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--rf4-accent);
  margin-bottom: 0.75rem;
  text-align: center;
}
.analytics-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.analytics-calendar-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--rf4-bg-muted);
  transition: background 0.15s, transform 0.1s;
}
.analytics-3months:not(.analytics-year-grid) .analytics-calendar-cell {
  width: 18px;
  height: 18px;
}
.analytics-3months:not(.analytics-year-grid) .analytics-month-block {
  min-width: 180px;
  padding: 1.1rem 1.25rem;
}
.analytics-calendar-cell:hover {
  outline: 1px solid var(--rf4-text-muted);
  outline-offset: 1px;
}
.analytics-calendar-cell.analytics-calendar-empty { opacity: 0.35; }
.analytics-calendar-cell.analytics-calendar-clickable { cursor: pointer; }
.analytics-calendar-level-0 { background: var(--rf4-bg-muted); }
.analytics-calendar-level-1 { background: #d4a012; }
.analytics-calendar-level-2 { background: #7bed7b; }
.analytics-calendar-level-3 { background: #238636; }
.analytics-calendar-cell.analytics-calendar-selected {
  outline: 2px solid #f0c14b;
  outline-offset: 1px;
}
.analytics-calendar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  margin-top: 0.25rem;
}
.analytics-calendar-legend .analytics-calendar-cell {
  width: 12px;
  height: 12px;
}
.analytics-calendar-legend .analytics-calendar-legend-0 { background: var(--rf4-bg-muted); }
.analytics-calendar-legend .analytics-calendar-legend-1 { background: #d4a012; }
.analytics-calendar-legend .analytics-calendar-legend-2 { background: #7bed7b; }
.analytics-calendar-legend .analytics-calendar-legend-3 { background: #238636; }
.analytics-calendar-legend-label { margin: 0 6px; white-space: nowrap; }

.analytics-topbar {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.analytics-topbar-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 32px;
}
.analytics-year-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.analytics-year-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}
.analytics-year-btn:hover:not(:disabled) {
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}
.analytics-year-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.analytics-year-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rf4-text);
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.analytics-month-tabs {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.analytics-month-tab {
  padding: 11px 4px;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--rf4-bg-elevated) 0%, var(--rf4-bg) 100%);
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.analytics-month-tab:hover {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
  border-color: var(--rf4-border);
}
.analytics-month-tab.is-active {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.22) 0%, rgba(88, 166, 255, 0.08) 100%);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.35), 0 4px 12px rgba(88, 166, 255, 0.12);
}
.analytics-month-tab.analytics-month-tab-all.is-active {
  background: linear-gradient(180deg, rgba(240, 193, 75, 0.2) 0%, rgba(240, 193, 75, 0.06) 100%);
  border-color: #f0c14b;
  color: #f0c14b;
  box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.35), 0 4px 12px rgba(240, 193, 75, 0.1);
}
.analytics-topbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--rf4-bg-muted);
}
.analytics-topbar-filters .analytics-select {
  flex: 1;
  min-width: 140px;
  max-width: 320px;
}
.analytics-fish-select {
  min-width: 140px;
}
@media (max-width: 720px) {
  .analytics-month-tabs {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .analytics-month-tab.analytics-month-tab-all {
    grid-column: 1 / -1;
  }
}
.analytics-3months.analytics-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
  justify-content: stretch;
}
.analytics-3months.analytics-year-grid .analytics-month-block {
  min-width: 0;
}
.analytics-3months.analytics-year-grid .analytics-month-block:first-child,
.analytics-3months.analytics-year-grid .analytics-month-block:last-child,
.analytics-3months.analytics-year-grid .analytics-month-block:nth-child(2) {
  order: unset;
  box-shadow: none;
}
.analytics-month-block.analytics-month-highlight {
  box-shadow: 0 0 0 2px var(--rf4-accent);
}
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}
.analytics-chart-section {
  margin-bottom: 0;
}
.analytics-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 180px;
}
.analytics-canvas-wrap-wide {
  min-height: 220px;
}
.analytics-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.analytics-toolbar-label {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
}
.analytics-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
  font-size: 0.9rem;
  min-width: 200px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.75rem;
}

.analytics-subtitle { font-weight: normal; color: var(--rf4-text-muted); font-size: 0.9em; }
.analytics-fish-hint {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}
.analytics-fish-search-wrap {
  margin-bottom: 0.85rem;
}
.analytics-fish-search {
  width: 100%;
  max-width: 320px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.9rem;
}
.analytics-fish-search:focus {
  outline: none;
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}
.analytics-fish-card.is-hidden {
  display: none;
}
.analytics-fish-no-match {
  margin: 0;
  padding: 1rem;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}
.analytics-date-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--rf4-bg);
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
}
.analytics-date-filter-label { font-size: 0.85rem; color: var(--rf4-text-muted); }
.analytics-date-filter-value { font-weight: 600; color: #f0c14b; }
.analytics-date-filter-clear {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.analytics-date-filter-clear:hover {
  background: #f85149;
  color: #fff;
}
.analytics-fish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}
.analytics-fish-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--rf4-shadow);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.analytics-fish-card:hover {
  border-color: var(--rf4-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px var(--rf4-shadow);
}
.analytics-fish-card-top-1 {
  border-color: rgba(210, 153, 34, 0.55);
  background: linear-gradient(165deg, rgba(210, 153, 34, 0.12) 0%, var(--rf4-bg-elevated) 55%, var(--rf4-bg-muted) 100%);
}
.analytics-fish-card-top-2 {
  border-color: rgba(139, 148, 158, 0.55);
}
.analytics-fish-card-top-3 {
  border-color: rgba(210, 153, 110, 0.55);
}
.analytics-fish-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  backdrop-filter: blur(6px);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--rf4-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 4px var(--rf4-shadow);
}
.analytics-fish-card-top-1 .analytics-fish-card-badge {
  color: #9a6700;
  border-color: rgba(210, 153, 34, 0.45);
  background: #fff8c5;
}
.analytics-fish-card-top-2 .analytics-fish-card-badge {
  color: var(--rf4-text);
}
.analytics-fish-card-top-3 .analytics-fish-card-badge {
  color: #9a6700;
}
.analytics-fish-card-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  padding: 10px 12px 6px;
  background: var(--rf4-bg);
}
.analytics-fish-card-visual img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px var(--rf4-shadow));
  transition: transform 0.2s;
}
.analytics-fish-card:hover .analytics-fish-card-visual img {
  transform: scale(1.06);
}
.analytics-fish-card-body {
  padding: 0.65rem 0.85rem 0.8rem;
  border-top: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
}
.analytics-fish-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
  color: var(--rf4-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}
.analytics-fish-card-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}
.analytics-fish-card-count {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--rf4-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.analytics-fish-card-unit {
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  text-transform: lowercase;
}
.analytics-fish-card-bar {
  height: 5px;
  background: var(--rf4-border);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.analytics-fish-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #238636, var(--rf4-accent));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.analytics-fish-card-top-1 .analytics-fish-card-bar-fill {
  background: linear-gradient(90deg, #d4a012, #f0c14b);
}

html[data-theme="dark"] .analytics-fish-card-top-1 {
  background: linear-gradient(165deg, #1f1a10 0%, #12110c 55%, var(--rf4-bg) 100%);
}

html[data-theme="dark"] .analytics-fish-card-top-1 .analytics-fish-card-badge {
  color: #f0c14b;
  border-color: rgba(240, 193, 75, 0.35);
  background: rgba(40, 32, 10, 0.88);
}

html[data-theme="dark"] .analytics-fish-card-top-3 .analytics-fish-card-badge {
  color: #d2996e;
}

html[data-theme="light"] .analytics-fish-card-unit {
  color: var(--rf4-text-soft) !important;
}

html[data-theme="light"] .analytics-fish-card-bar {
  background: #d0d7de;
}
.analytics-loc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analytics-loc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-bg-muted);
  background: linear-gradient(90deg, var(--rf4-bg) 0%, var(--rf4-bg-elevated) 100%);
  transition: border-color 0.15s, background 0.15s;
}
.analytics-loc-row:hover {
  border-color: var(--rf4-border);
  background: var(--rf4-bg-elevated);
}
.analytics-loc-name {
  flex: 1;
  min-width: 0;
  color: var(--rf4-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-loc-count {
  font-weight: 600;
  color: var(--rf4-accent);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}
.analytics-loc-bar {
  flex: 0 0 100px;
  height: 8px;
  background: var(--rf4-bg-muted);
  border-radius: 4px;
  overflow: hidden;
}
.analytics-loc-bar-fill {
  height: 100%;
  background: var(--rf4-accent);
  border-radius: 4px;
}
.analytics-loc-list-compact .analytics-loc-bar {
  flex: 0 0 72px;
}
.analytics-bait-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analytics-bait-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-bg-muted);
  background: linear-gradient(90deg, var(--rf4-bg) 0%, var(--rf4-bg-elevated) 100%);
}
.analytics-bait-rank {
  color: var(--rf4-text-muted);
  font-weight: 700;
  min-width: 1.25rem;
  font-size: 0.8rem;
}
.analytics-bait-name {
  flex: 1;
  min-width: 0;
  color: var(--rf4-text);
}
.analytics-bait-name.is-best {
  color: #f0c14b;
  font-weight: 600;
}
.analytics-bait-count {
  font-weight: 600;
  color: #7ee787;
  min-width: 2rem;
  text-align: right;
}
.analytics-bait-bar {
  flex: 0 0 80px;
  height: 8px;
  background: var(--rf4-bg-muted);
  border-radius: 4px;
  overflow: hidden;
}
.analytics-bait-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a012, #7ee787);
  border-radius: 4px;
}
.analytics-bait-source {
  font-weight: normal;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}
.analytics-no-data { margin: 0; color: var(--rf4-text-muted); font-size: 0.9rem; }

.analytics-fish-modal .modal-content { max-width: 640px; }
.analytics-fish-modal-content { padding: 1.25rem; }
.analytics-fish-modal-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.analytics-fish-modal-img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--rf4-bg-muted);
  flex-shrink: 0;
}
.analytics-fish-modal-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.analytics-fish-modal-title { margin: 0 0 0.35rem; font-size: 1.2rem; color: var(--rf4-text); }
.analytics-fish-modal-hint { margin: 0; font-size: 0.88rem; color: var(--rf4-text-muted); line-height: 1.4; }
.analytics-fish-modal-main {
  position: relative;
  min-height: 220px;
}
.analytics-fish-modal-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}
.analytics-insight-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rf4-bg-elevated) 0%, var(--rf4-bg) 100%);
  border: 1px solid var(--rf4-border);
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.analytics-insight-chip strong {
  color: #f0c14b;
  font-weight: 700;
}
.analytics-fish-modal-body { display: flex; flex-direction: column; gap: 1.25rem; }
.analytics-fish-modal-block h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--rf4-text-soft);
}
.analytics-fish-modal-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.analytics-fish-modal-chart h4 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--rf4-text-muted); }

/* legacy fish tags — removed from UI */
.analytics-fish-tags { display: none; }
.analytics-fish-tag-pct { display: none; }

.nav-item.nav-tab-hidden {
  display: none !important;
}


/* --------------------------------------------
   Wear calculator (Калькулятор износа снастей)
   -------------------------------------------- */
#panelWear.tab-panel.active {
  display: flex;
  flex-direction: column;
}

#panelWear .tab-content-inner.tab-content-wear {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.25rem;
}

.tab-content-wear {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: none;
  min-height: 0;
}

.wear-header {
  flex-shrink: 0;
  margin-bottom: 0;
}

.wear-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.wear-header-text {
  flex: 1;
  min-width: 200px;
}

.wear-page-title {
  margin: 0 0 0.35rem;
}

.wear-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
  max-width: 42rem;
}

.wear-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Переключатель: Удилище / Катушка */
.wear-type-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 4px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.wear-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.wear-type-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wear-type-tab-icon {
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.85;
}

.wear-type-tab-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
}

.wear-type-tab:hover .wear-type-tab-label {
  color: var(--rf4-text-soft);
}

.wear-type-tab:has(input:checked) {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.22) 0%, rgba(88, 166, 255, 0.1) 100%);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.35), 0 2px 8px rgba(88, 166, 255, 0.12);
}

.wear-type-tab:has(input:checked) .wear-type-tab-label {
  color: var(--rf4-accent);
}

.wear-type-tab:has(input:checked) .wear-type-tab-icon {
  opacity: 1;
}

/* Рабочая область */
.wear-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wear-calc-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.wear-workspace-grid {
  display: grid;
  grid-template-columns: clamp(280px, 36%, 440px) 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

/* Каталог слева */
.wear-catalog {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.wear-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rf4-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  flex-shrink: 0;
}

.wear-catalog-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rf4-text-muted);
}

.wear-catalog-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  font-variant-numeric: tabular-nums;
}

.wear-catalog-filters {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.55rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
}

.wear-catalog-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rf4-text-soft);
  white-space: nowrap;
}

.wear-catalog-filter-select {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  font-size: 0.78rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
}

.wear-pick-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--rf4-border);
}

.wear-pick-search {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.1rem;
  font-size: 0.9rem;
  background: var(--rf4-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236e7681' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 0.65rem center;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wear-pick-search:hover {
  border-color: var(--rf4-border);
}

.wear-pick-search:focus {
  border-color: var(--rf4-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.wear-catalog-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.5rem;
  align-content: start;
}

.wear-catalog-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.4rem 0.55rem;
  background: var(--rf4-bg-muted);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.wear-catalog-item:hover {
  border-color: var(--rf4-border);
  background: #262c36;
  transform: translateY(-1px);
}

.wear-catalog-item.focused {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.wear-catalog-item.selected {
  border-color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.25), 0 4px 12px rgba(88, 166, 255, 0.1);
}

.wear-catalog-item-img-wrap {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wear-catalog-item-img-wrap--placeholder {
  font-size: 1.4rem;
  opacity: 0.45;
}

.wear-catalog-item-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wear-catalog-item-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rf4-text-soft);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.wear-catalog-item.selected .wear-catalog-item-name {
  color: var(--rf4-accent);
}

.wear-catalog-item-stat {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--rf4-accent);
  font-variant-numeric: tabular-nums;
}

.wear-pick-empty {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
  font-size: 0.88rem;
  color: var(--rf4-text-muted);
  text-align: center;
  line-height: 1.5;
}

/* Панель деталей справа */
.wear-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.wear-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 2rem;
  text-align: center;
  min-height: 200px;
}

.wear-detail-empty-icon {
  font-size: 3rem;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}

.wear-detail-empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
}

.wear-detail-empty-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  max-width: 22rem;
  line-height: 1.45;
}

.wear-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Герой-карточка выбранной снасти */
.wear-item-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(88, 166, 255, 0.02) 50%, transparent 100%);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 12px;
  flex-shrink: 0;
}

.wear-item-hero-img-wrap {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.wear-item-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wear-item-hero-info {
  flex: 1;
  min-width: 0;
}

.wear-item-hero-name {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.3;
}

.wear-hero-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.wear-hero-stat {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
}

.wear-hero-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rf4-text-muted);
  width: 100%;
}

.wear-hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--rf4-accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.wear-hero-stat-unit {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--rf4-text-muted);
}

.wear-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Группа ввода износа */
.wear-input-group {
  margin-bottom: 0;
}

.wear-input-group--stat {
  padding: 1.1rem 1.15rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
}

.wear-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.wear-slider-head label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--rf4-text-soft);
}

.wear-slider-pct {
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--rf4-accent);
  min-width: 3.5rem;
  text-align: right;
}

.wear-slider-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Ползунок: трек и бегунок от края до края (компенсация отступов WebKit) */
.range-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.rf4-range {
  --rf4-range-track-h: 6px;
  --rf4-range-thumb: 18px;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: calc(100% + var(--rf4-range-thumb));
  height: var(--rf4-range-thumb);
  margin: 0 calc(var(--rf4-range-thumb) / -2);
  padding: 0;
  border: none;
  background: transparent;
  outline: none;
  cursor: pointer;
}

.rf4-range::-webkit-slider-runnable-track {
  height: var(--rf4-range-track-h);
  background: var(--rf4-border);
  border-radius: 999px;
  border: none;
}

.rf4-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--rf4-range-thumb);
  height: var(--rf4-range-thumb);
  margin-top: calc((var(--rf4-range-track-h) - var(--rf4-range-thumb)) / 2);
  border-radius: 50%;
  background: var(--rf4-accent);
  border: 2px solid var(--rf4-bg);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.rf4-range::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
}

.rf4-range::-moz-range-track {
  height: var(--rf4-range-track-h);
  background: var(--rf4-border);
  border-radius: 999px;
  border: none;
}

.rf4-range::-moz-range-thumb {
  width: var(--rf4-range-thumb);
  height: var(--rf4-range-thumb);
  border-radius: 50%;
  background: var(--rf4-accent);
  border: 2px solid var(--rf4-bg);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.35);
  cursor: pointer;
}

.wear-slider-num-wrap {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.wear-slider-num {
  width: 3.5rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
}

.wear-slider-num:focus {
  border-color: var(--rf4-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.wear-slider-unit {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.wear-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.wear-preset-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.wear-preset-btn:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-text-soft);
  background: rgba(88, 166, 255, 0.08);
}

.wear-preset-btn.active {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.15);
}

.wear-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}

/* Блоки катушки: два поля износа в ряд */
.wear-reel-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.wear-result-box {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.wear-compare-card {
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.08) 0%, rgba(88, 166, 255, 0.02) 100%);
  border: 1px solid rgba(88, 166, 255, 0.22);
  border-radius: 12px;
}

.wear-compare-card--compact {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: var(--rf4-bg-elevated);
  border-color: var(--rf4-border);
}

.wear-compare-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rf4-text-muted);
  margin-bottom: 0.55rem;
}

.wear-bar-track {
  height: 8px;
  background: var(--rf4-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.wear-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3fb950 0%, var(--rf4-accent) 55%, #d29922 80%, #f85149 100%);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.2s ease;
}

.wear-compare-values {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.wear-compare-from {
  font-size: 0.95rem;
  color: var(--rf4-text-muted);
  font-variant-numeric: tabular-nums;
  text-decoration: line-through;
  text-decoration-color: rgba(110, 118, 129, 0.55);
}

.wear-compare-arrow {
  color: var(--rf4-border);
  font-size: 0.9rem;
}

.wear-compare-to {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--rf4-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.wear-compare-loss {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f85149;
  margin-left: auto;
}

.wear-compare-loss:empty {
  display: none;
}

.wear-loading-msg,
.wear-error-msg {
  flex-shrink: 0;
  margin: 0;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  text-align: center;
}

.wear-loading-msg {
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
}

.wear-error-msg {
  color: #f85149;
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

@media (max-width: 900px) {
  .wear-workspace-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 38vh) 1fr;
  }

  .wear-reel-inputs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .wear-header-row {
    flex-direction: column;
  }

  .wear-type-switch {
    width: 100%;
  }

  .wear-type-tab {
    flex: 1;
    justify-content: center;
  }

  .wear-item-hero {
    flex-direction: column;
    text-align: center;
  }

  .wear-hero-stat {
    justify-content: center;
  }

  .wear-hero-stat-label {
    text-align: center;
  }
}

/* --------------------------------------------
   Будильник (игровое время)
   -------------------------------------------- */
.tab-content-budilnik {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 2rem 1rem;
  text-align: center;
}

.budilnik-current-time {
  font-size: 2.5rem;
  font-family: monospace;
  font-weight: 700;
  color: var(--rf4-accent);
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
  text-shadow: 0 0 20px rgba(88, 166, 255, 0.25);
}

.budilnik-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.budilnik-time-input {
  padding: 0.6rem 1rem;
  font-size: 1.25rem;
  font-family: monospace;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  color: var(--rf4-text);
}

.budilnik-time-input:focus {
  border-color: var(--rf4-accent);
  outline: none;
}

.budilnik-add-btn {
  padding: 0.6rem 1.25rem;
}

.budilnik-sound-row-mini {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.budilnik-sound-row-mini .budilnik-sound-select {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
}

.budilnik-sound-name {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.budilnik-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 320px;
}

.budilnik-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.budilnik-item-time {
  font-family: monospace;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--rf4-accent);
}

.budilnik-item-delete {
  padding: 0.2rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--rf4-text-muted);
  background: transparent;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
}

.budilnik-item-delete:hover {
  color: #f85149;
  border-color: #f85149;
}

.budilnik-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
}

.budilnik-settings-modal .modal-content {
  max-width: 420px;
}

.budilnik-ring-modal {
  background: var(--rf4-bg);
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.budilnik-ring-backdrop {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.budilnik-ring-content {
  text-align: center;
  padding: 2.5rem 3rem;
  background: var(--rf4-bg-elevated);
  border: 2px solid var(--rf4-border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.budilnik-ring-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.budilnik-ring-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.budilnik-ring-time {
  margin: 0 0 1.5rem 0;
  font-size: 2rem;
  font-family: monospace;
  font-weight: 700;
  color: var(--rf4-accent);
}

.budilnik-ring-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.budilnik-ring-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  border: none;
}

.budilnik-ring-snooze {
  background: #238636;
  color: #fff;
}

.budilnik-ring-snooze:hover {
  background: #2ea043;
}

.budilnik-ring-off {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
  border: 1px solid var(--rf4-border);
}

.budilnik-ring-off:hover {
  background: var(--rf4-border);
  border-color: #f85149;
  color: #f85149;
}

.budilnik-ring-swipe-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 1;
  cursor: pointer;
}

.budilnik-swipe-zone-right {
  left: 0;
}

.budilnik-swipe-zone-left {
  right: 0;
}

/* —— Моя музыка (локальный плеер) —— */
.music-player-modal .modal-content {
  max-width: 520px;
  width: min(520px, calc(100vw - 2rem));
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.music-player-modal-content {
  gap: 0;
  display: flex;
  flex-direction: column;
  min-height: 460px;
  max-height: min(88vh, 720px);
}

.music-player-head {
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--rf4-border);
  flex-shrink: 0;
  background: var(--rf4-bg-elevated);
}

.music-player-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.music-source-tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.music-source-tab {
  flex: 1;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.music-source-tab:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.music-source-tab.active {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.music-vk-auth {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.music-vk-auth-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}

.music-vk-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.music-vk-input {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.88rem;
}

.music-vk-auth-success {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #3fb950;
  line-height: 1.4;
}

.music-settings-auth {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

#musicSettingsSection .music-vk-qr-block {
  margin: 0;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  text-align: center;
}

.music-vk-qr-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 196px;
  margin-bottom: 0.75rem;
}

.music-vk-qr-placeholder {
  margin: 0;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px dashed var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.75rem;
  box-sizing: border-box;
}

.music-vk-qr-image-wrap.is-visible + .music-vk-qr-placeholder,
.music-vk-qr-slot:has(.music-vk-qr-image-wrap.is-visible) .music-vk-qr-placeholder {
  display: none;
}

.music-vk-auth-steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
}

.music-vk-confirm-btn {
  align-self: flex-start;
}

#musicSettingsSection.music-settings-highlight {
  box-shadow: inset 0 0 0 2px rgba(88, 166, 255, 0.35);
}

.music-vk-message-box {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
}

.music-vk-message-box[hidden] {
  display: none !important;
}

.music-vk-message-box.is-error {
  border-color: rgba(248, 81, 73, 0.5);
  background: rgba(248, 81, 73, 0.08);
}

.music-vk-message-box.is-success {
  border-color: rgba(46, 160, 67, 0.5);
  background: rgba(46, 160, 67, 0.08);
}

.music-vk-message-text {
  flex: 1;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--rf4-text);
}

.music-vk-message-box.is-error .music-vk-message-text {
  color: #f85149;
}

.music-vk-message-box.is-success .music-vk-message-text {
  color: #3fb950;
}

.music-vk-message-dismiss {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.music-vk-message-dismiss:hover {
  color: var(--rf4-text);
  background: rgba(255, 255, 255, 0.06);
}

.music-vk-token-fallback {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rf4-border);
}

.music-vk-token-summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--rf4-text-muted);
  user-select: none;
}

.music-vk-token-summary:hover {
  color: var(--rf4-text-soft);
}

.music-vk-token-hint {
  margin: 0.5rem 0 0.65rem;
  font-size: 0.78rem;
}

.music-vk-paste-hint {
  margin: 0 0 0.5rem;
  font-size: 0.84rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}

.music-vk-token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.music-vk-token-link {
  font-size: 0.78rem;
  color: var(--rf4-accent);
  text-decoration: none;
}

.music-vk-token-link:hover {
  text-decoration: underline;
}

.music-vk-token-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.music-vk-token-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.8rem;
}

.music-vk-auth-error {
  margin: 0;
  font-size: 0.8rem;
  color: #f85149;
}

.music-vk-auth-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
}

.music-vk-qr-block {
  margin-bottom: 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  text-align: center;
}

.music-vk-qr-image-wrap {
  display: none;
  justify-content: center;
  margin-bottom: 0;
}

.music-vk-qr-image-wrap.is-visible {
  display: flex;
}

.music-vk-qr-image {
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  max-width: 100%;
  height: auto;
}

.music-vk-qr-status {
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  margin: 0.75rem 0 0;
  min-height: 1.25em;
  line-height: 1.4;
}

.music-vk-qr-status--error {
  color: var(--rf4-text-muted);
}

.music-vk-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  flex-shrink: 0;
}

.music-vk-nav-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.music-vk-nav-btn:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.music-vk-nav-btn.active {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
  background: rgba(88, 166, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.25);
}

.music-track-item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.settings-music-vk-status {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.settings-vk-login {
  align-items: center;
}

.music-player-folder {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.music-vk-nav {
  flex-shrink: 0;
}

.music-player-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  flex-shrink: 0;
}

.music-search-wrap {
  flex: 1;
  min-width: 0;
}

.music-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.88rem;
}

.music-search-input:focus {
  outline: none;
  border-color: var(--rf4-accent);
}

.music-refresh-btn {
  min-width: 2.25rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.music-track-list-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.25rem 0.35rem;
}

.music-track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.music-track-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.15rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rf4-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  min-width: 0;
}

.music-playlist-item .music-track-icon {
  background: rgba(88, 166, 255, 0.12);
}

.music-track-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  font-size: 0.95rem;
  line-height: 1;
}

.music-track-dur {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: 0.35rem;
}

.music-list-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--rf4-text-muted);
  font-size: 0.88rem;
}

.music-list-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border-width: 2px;
}

.music-track-item:hover {
  background: var(--rf4-bg-muted);
}

.music-track-item--active {
  background: rgba(88, 166, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.35);
}

.music-track-num {
  flex-shrink: 0;
  width: 1.5rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.music-track-text {
  min-width: 0;
  flex: 1;
}

.music-track-title {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-track-sub {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-empty {
  margin: 1.5rem 1rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

.music-player-controls {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
  flex-shrink: 0;
}

.music-now-playing {
  margin-bottom: 0.55rem;
  min-width: 0;
}

.music-now-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rf4-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-now-folder {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-play-hint {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--rf4-text-soft);
  line-height: 1.35;
}

.music-play-hint.is-error {
  color: #f85149;
}

.music-play-hint.is-hidden {
  display: none;
}

.music-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.music-ctrl-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: 0 1px 2px var(--rf4-shadow);
}

.music-ctrl-btn:hover {
  border-color: var(--rf4-accent);
  background: var(--rf4-bg);
  color: var(--rf4-accent);
}

.music-ctrl-btn-play {
  width: 2.65rem;
  height: 2.65rem;
  font-size: 1.05rem;
}

.music-ctrl-btn[aria-pressed="true"] {
  border-color: #2ea043;
  color: #1a7f37;
  background: rgba(46, 160, 67, 0.12);
}

html[data-theme="dark"] .music-ctrl-btn[aria-pressed="true"] {
  border-color: #b8d96e;
  color: #b8d96e;
  background: rgba(184, 217, 110, 0.12);
}

.music-ctrl-btn-repeat-one {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.music-progress-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.music-volume-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.music-volume-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.85;
}

.music-volume-wrap {
  flex: 1;
  min-width: 0;
}

.music-volume-value {
  flex-shrink: 0;
  min-width: 2.5rem;
  font-size: 0.72rem;
  color: var(--rf4-text-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.music-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--rf4-text-soft);
  font-variant-numeric: tabular-nums;
  min-width: 2.2rem;
}

.music-progress-wrap {
  flex: 1;
  min-width: 0;
}

.music-progress {
  width: 100%;
}

.music-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.music-mini-bar {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  box-shadow: 0 2px 12px var(--rf4-shadow);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.music-mini-bar.visible {
  display: flex;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.music-mini-progress {
  height: 3px;
  background: var(--rf4-bg-muted);
  flex-shrink: 0;
}

.music-mini-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rf4-accent), var(--rf4-accent));
  border-radius: 0 2px 2px 0;
  transition: width 0.15s linear;
}

.music-mini-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.45rem 0.28rem 0.35rem;
  min-height: 40px;
}

.music-mini-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.45rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rf4-text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.music-mini-open:hover {
  background: var(--rf4-bg-muted);
}

.music-mini-cover {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(88, 166, 255, 0.22), rgba(56, 139, 253, 0.08));
  border: 1px solid rgba(88, 166, 255, 0.25);
  font-size: 0.95rem;
}

body.music-playing .music-mini-cover {
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.music-mini-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.music-mini-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--rf4-text);
}

.music-mini-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.2;
  color: var(--rf4-text-muted);
}

.music-mini-transport {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding-left: 0.15rem;
}

.music-mini-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--rf4-text-soft);
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.music-mini-btn:hover {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
}

.music-mini-btn-play {
  width: 2.15rem;
  height: 2.15rem;
  background: rgba(88, 166, 255, 0.18);
  color: var(--rf4-accent);
  font-size: 0.88rem;
}

.music-mini-btn-play:hover {
  background: rgba(88, 166, 255, 0.3);
  color: var(--rf4-accent);
}

body:has(#settingsModal.open) .music-mini-bar,
body:has(#musicPlayerModal.open) .music-mini-bar,
body:has(.modal-settings-wrap.open) .music-mini-bar {
  display: none !important;
  pointer-events: none;
}

/* --------------------------------------------
   General chat
   -------------------------------------------- */
.chat-fab {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 1280;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(22, 27, 34, 0.96), rgba(13, 17, 23, 0.98));
  color: var(--rf4-text);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: visible;
}

.chat-fab.visible {
  display: flex;
}

.chat-fab:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 166, 255, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.chat-fab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #f85149;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--rf4-bg);
  pointer-events: none;
  z-index: 1;
}

.chat-fab-badge.is-zero {
  background: var(--rf4-text-muted);
}

.chat-fab-badge[hidden] {
  display: none !important;
}

body:has(#chatModal.open) .chat-fab {
  display: none !important;
}

.chat-modal {
  z-index: 1250;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.chat-modal.open {
  display: flex;
  pointer-events: auto;
}

.chat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.chat-modal-content {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - var(--sidebar-w, 200px) - 28px));
  height: min(720px, 82vh);
  max-width: none;
  max-height: none;
  margin: 0 14px 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-modal-head {
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  flex-shrink: 0;
}

.chat-modal-title {
  margin: 0;
  font-size: 1.05rem;
}

.chat-modal-sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.chat-messages-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--rf4-bg);
}

.chat-load-more {
  flex-shrink: 0;
  margin: 0.45rem auto 0;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.chat-load-more:hover {
  color: var(--rf4-text-soft);
  border-color: var(--rf4-border);
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-empty,
.chat-loading,
.chat-guest-hint {
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  text-align: center;
}

.chat-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rf4-loading-scrim);
  color: var(--rf4-text-soft);
  z-index: 2;
}

.chat-loading[hidden],
.chat-empty[hidden] {
  display: none !important;
}

.chat-message {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  max-width: 96%;
}

.chat-message--self {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message--other {
  align-self: flex-start;
}

.chat-message-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rf4-text-muted);
}

.chat-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-message-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chat-message--self .chat-message-body {
  align-items: flex-end;
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
}

.chat-message--self .chat-message-meta {
  justify-content: flex-end;
}

.chat-message-name {
  font-weight: 600;
  color: var(--rf4-text-soft);
}

.chat-message-name.is-admin {
  color: #ff7b72;
}

.chat-message-name.is-moderator {
  color: var(--rf4-accent);
}

.chat-message-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.chat-message-role-badge.is-admin {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.45);
  color: #ff7b72;
}

.chat-message-role-badge.is-moderator {
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.4);
  color: var(--rf4-accent);
}

.chat-message-event {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.chat-message-event-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.chat-message-event-pill.is-level-up {
  background: rgba(210, 153, 34, 0.16);
  border: 1px solid rgba(210, 153, 34, 0.45);
  color: #e3b341;
}

.chat-message-event-pill.is-achievement {
  background: rgba(163, 113, 247, 0.14);
  border: 1px solid rgba(163, 113, 247, 0.42);
  color: #d2a8ff;
}

.chat-message-photo {
  margin-top: 0.35rem;
  width: min(100%, 280px);
  min-height: 160px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-message-photo img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.chat-message-lvl {
  color: var(--rf4-accent);
  font-weight: 600;
}

.chat-message-bubble {
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-message--other .chat-message-bubble {
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-bottom-left-radius: 4px;
}

.chat-message--self .chat-message-bubble {
  background: linear-gradient(145deg, #1f6feb, var(--rf4-accent));
  border: 1px solid rgba(88, 166, 255, 0.35);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-message--self .chat-message-bubble a {
  color: #ffffff;
  text-decoration: underline;
}

.chat-message-time {
  font-size: 0.68rem;
  color: var(--rf4-text-muted);
  padding: 0 0.15rem;
}

.chat-date-separator {
  align-self: center;
  margin: 0.35rem 0;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-muted);
  font-size: 0.75rem;
}

.chat-unread-separator {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.45rem 0.25rem;
  color: var(--rf4-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chat-unread-separator::before,
.chat-unread-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rf4-accent)88, transparent);
}

.chat-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.chat-message-action-btn {
  background: transparent;
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-muted);
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  cursor: pointer;
}

.chat-message-action-btn:hover {
  color: var(--rf4-text-soft);
  border-color: var(--rf4-border);
}

.chat-message-action-btn--reply {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(35, 134, 54, 0.12);
}

.chat-message-action-btn--reply:hover {
  color: #56d364;
  border-color: rgba(63, 185, 80, 0.7);
  background: rgba(35, 134, 54, 0.2);
}

html[data-theme="light"] .chat-message-action-btn--reply {
  color: #1a7f37;
  border-color: rgba(26, 127, 55, 0.35);
  background: rgba(26, 127, 55, 0.08);
}

html[data-theme="light"] .chat-message-action-btn--reply:hover {
  color: #116329;
  border-color: rgba(26, 127, 55, 0.55);
  background: rgba(26, 127, 55, 0.14);
}

.chat-message-action-btn--danger:hover {
  color: #ff7b72;
  border-color: #f85149;
}

.chat-message-edited {
  color: var(--rf4-text-muted);
  font-style: italic;
  font-weight: 500;
}

.chat-edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0.75rem 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-accent)55;
  background: #1f6feb22;
  color: var(--rf4-text-soft);
}

.chat-edit-banner[hidden] {
  display: none !important;
}

.chat-edit-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  font-size: 0.78rem;
}

.chat-edit-banner-text strong {
  color: var(--rf4-accent);
  font-size: 0.74rem;
}

.chat-edit-banner-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--rf4-text-muted);
}

.chat-edit-banner-cancel {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.chat-edit-banner-cancel:hover {
  color: var(--rf4-text);
  background: var(--rf4-border);
}

.chat-reply-banner {
  position: relative;
  overflow: hidden;
  border-color: rgba(63, 185, 80, 0.45);
  background: linear-gradient(135deg, rgba(35, 134, 54, 0.18), rgba(63, 185, 80, 0.08));
  box-shadow: inset 3px 0 0 #3fb950;
  padding-left: 0.85rem;
}

.chat-reply-banner .chat-edit-banner-text strong {
  color: #3fb950;
  letter-spacing: 0.02em;
}

html[data-theme="light"] .chat-reply-banner {
  border-color: rgba(26, 127, 55, 0.35);
  background: linear-gradient(135deg, rgba(26, 127, 55, 0.12), rgba(218, 251, 225, 0.65));
  box-shadow: inset 3px 0 0 #1a7f37;
}

html[data-theme="light"] .chat-reply-banner .chat-edit-banner-text strong {
  color: #1a7f37;
}

.chat-reply-quote {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 0.4rem;
  padding: 0;
  border: 1px solid rgba(63, 185, 80, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(35, 134, 54, 0.14), rgba(63, 185, 80, 0.05));
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.chat-reply-quote:hover {
  border-color: rgba(63, 185, 80, 0.55);
  background: linear-gradient(135deg, rgba(35, 134, 54, 0.22), rgba(63, 185, 80, 0.1));
  transform: translateY(-1px);
}

.chat-reply-quote:focus-visible {
  outline: 2px solid #3fb950;
  outline-offset: 2px;
}

.chat-reply-quote-bar {
  flex-shrink: 0;
  width: 4px;
  background: linear-gradient(180deg, #56d364 0%, #238636 100%);
}

.chat-reply-quote-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
  padding: 0.4rem 0.6rem 0.42rem;
}

.chat-reply-quote-label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3fb950;
  opacity: 0.9;
}

.chat-reply-quote-label::before {
  content: "↩";
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.chat-message--self .chat-reply-quote {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.chat-message--self .chat-reply-quote:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
}

.chat-message--self .chat-reply-quote-bar {
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.55) 100%);
}

.chat-message--self .chat-reply-quote-label,
.chat-message--self .chat-reply-quote-author {
  color: #ffffff;
}

.chat-message--self .chat-reply-quote-text {
  color: rgba(255, 255, 255, 0.88);
}

.chat-reply-quote-author {
  font-size: 0.76rem;
  font-weight: 700;
  color: #3fb950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply-quote-text {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--rf4-text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply-quote:hover .chat-reply-quote-text {
  color: var(--rf4-text);
}

html[data-theme="light"] .chat-reply-quote {
  border-color: rgba(26, 127, 55, 0.28);
  background: linear-gradient(135deg, rgba(218, 251, 225, 0.9), rgba(246, 248, 250, 0.95));
}

html[data-theme="light"] .chat-reply-quote:hover {
  border-color: rgba(26, 127, 55, 0.5);
  background: linear-gradient(135deg, #dafbe1, #ffffff);
}

html[data-theme="light"] .chat-reply-quote-bar {
  background: linear-gradient(180deg, #4ac26b 0%, #1a7f37 100%);
}

html[data-theme="light"] .chat-reply-quote-label,
html[data-theme="light"] .chat-reply-quote-author {
  color: #1a7f37;
}

html[data-theme="light"] .chat-reply-quote-text {
  color: var(--rf4-text-muted);
}

html[data-theme="light"] .chat-reply-quote:hover .chat-reply-quote-text {
  color: var(--rf4-text);
}

.chat-message--flash {
  animation: chatMsgFlash 1.25s ease;
  border-radius: 12px;
}

@keyframes chatMsgFlash {
  0%, 100% {
    background-color: transparent;
    box-shadow: none;
  }
  25% {
    background-color: rgba(63, 185, 80, 0.22);
    box-shadow: 0 0 0 2px rgba(63, 185, 80, 0.45);
  }
  55% {
    background-color: rgba(63, 185, 80, 0.12);
    box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.25);
  }
}

.chat-shared-post {
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  max-width: 100%;
}

.chat-message--self .chat-shared-post {
  border-color: var(--rf4-accent)66;
  background: var(--rf4-bg);
}

.chat-shared-post-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rf4-text-muted);
  margin-bottom: 0.25rem;
}

.chat-shared-post-loc {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--rf4-text-soft);
  margin-bottom: 0.15rem;
}

.chat-shared-post-fish,
.chat-shared-post-coords {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.1rem;
}

.chat-shared-post-preview {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--rf4-text-soft);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.chat-shared-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.chat-shared-post-btn {
  background: transparent;
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-muted);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.chat-shared-post-btn:hover {
  color: var(--rf4-text-soft);
  border-color: var(--rf4-border);
}

.chat-shared-post-btn--primary {
  color: var(--rf4-accent);
  border-color: var(--rf4-accent)66;
}

.chat-shared-post-btn--primary:hover {
  color: #a5d6ff;
  border-color: var(--rf4-accent);
}

.chat-mention {
  display: inline;
  padding: 0.05em 0.28em;
  margin: 0 0.05em;
  border: 0;
  border-radius: 4px;
  background: rgba(56, 139, 253, 0.18);
  color: var(--rf4-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  vertical-align: baseline;
}

.chat-mention:hover {
  background: rgba(56, 139, 253, 0.32);
  text-decoration: underline;
}

.chat-link {
  color: var(--rf4-accent);
  word-break: break-all;
}

.chat-link:hover {
  text-decoration: underline;
}

.chat-compose-wrap {
  flex-shrink: 0;
  border-top: 1px solid var(--rf4-bg-muted);
  padding: 0.65rem 0.75rem 0.75rem;
  background: var(--rf4-bg-elevated);
  position: relative;
}

.chat-guest-hint {
  margin: 0 0 0.5rem;
  text-align: left;
  font-size: 0.78rem;
}

.chat-ban-hint {
  color: #ffa657;
}

.chat-ban-duration-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.chat-ban-duration-btn {
  flex: 0 0 auto;
  min-width: 4.5rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: var(--rf4-text-soft);
  font-size: 0.8rem;
  cursor: pointer;
}

.chat-ban-duration-btn:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.chat-ban-duration-btn.is-active {
  border-color: #f85149;
  background: rgba(248, 81, 73, 0.15);
  color: #ff7b72;
  font-weight: 600;
}

.chat-compose-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  text-align: right;
}

.devchat-compose-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}

.devchat-category-label {
  font-size: 12px;
  color: var(--rf4-text-muted);
}

.devchat-category {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 280px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.devchat-char-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--rf4-text-muted);
  font-variant-numeric: tabular-nums;
}

.devchat-char-count.is-near-limit {
  color: #d29922;
}

.devchat-char-count.is-at-limit {
  color: #f85149;
}

.chat-compose {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}

.chat-attach-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-soft);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chat-attach-btn:hover:not(:disabled) {
  border-color: var(--rf4-border);
  background: var(--rf4-border);
}

.chat-attach-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-attach-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  pointer-events: none;
}

.chat-compose-photo-preview {
  position: relative;
  display: inline-block;
  margin-bottom: 0.45rem;
  max-width: 160px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
}

.chat-compose-photo-preview[hidden] {
  display: none !important;
}

.chat-compose-photo-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
}

.chat-compose-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.82);
  color: var(--rf4-text);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.chat-compose-photo-remove:hover {
  background: rgba(248, 81, 73, 0.85);
}

.chat-compose-input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 7rem;
  resize: vertical;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  line-height: 1.35;
}

.chat-compose-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-send-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 10px;
  background: #238636 !important;
  border-color: #2ea043 !important;
  color: #ffffff !important;
}

.chat-send-btn:hover:not(:disabled) {
  background: #2ea043 !important;
  border-color: #3fb950 !important;
}

.chat-send-btn:disabled {
  opacity: 0.55;
}

.chat-send-icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: none !important;
}

.chat-mention-suggest {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(100% + 4px);
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.chat-mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--rf4-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.chat-mention-item:hover,
.chat-mention-item.is-active {
  background: rgba(88, 166, 255, 0.12);
}

.chat-mention-item-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--rf4-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.chat-mention-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-mention-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.chat-mention-item-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.chat-mention-item-name.is-admin {
  color: #ff7b72;
}

.chat-mention-item-name.is-moderator {
  color: var(--rf4-accent);
}

.chat-mention-item-login {
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
}

/* --------------------------------------------
   Skills (Навыки)
   -------------------------------------------- */
.tab-content-skills {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.skills-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.skills-home {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.skills-category-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  overflow: hidden;
}

.skills-category-view[hidden] {
  display: none !important;
}

.skills-home[hidden] {
  display: none !important;
}

.skills-category-topbar {
  flex-shrink: 0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
}

.skills-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--rf4-text-soft);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.skills-back-btn:hover {
  color: var(--rf4-text);
  background: var(--rf4-border);
  border-color: rgba(184, 217, 110, 0.45);
}

.skills-back-btn:focus-visible {
  outline: 2px solid #b8d96e;
  outline-offset: 2px;
}

.skills-category-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skills-category-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 400px);
  align-items: stretch;
}

.skills-tree-col {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 0.5rem;
}

.skills-tree-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
}

@media (min-width: 1000px) {
  .skills-tree-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.skills-panel-head {
  flex-shrink: 0;
  padding: 0.85rem 1rem 0.65rem;
}

.skills-panel-head-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.35;
}

.skills-panel-head-title .skills-panel-pct {
  color: #b8d96e;
  font-weight: 800;
}

.skills-panel-head-meta {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--rf4-text-muted);
}

.skills-panel-head-meta strong {
  color: #b8d96e;
  font-weight: 800;
}

.skills-panel-divider {
  flex-shrink: 0;
  height: 1px;
  margin: 0 1rem;
  background: var(--rf4-border);
}

.skills-panel-soon {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  font-style: italic;
}

.skill-tree-node {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 62px;
  padding: 0.45rem 0.65rem;
  text-align: left;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 2px;
  cursor: pointer;
  color: var(--rf4-text);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.skill-tree-node:hover:not(:disabled) {
  background: var(--rf4-bg-elevated);
  border-color: var(--rf4-accent);
}

.skill-tree-node--active {
  background: var(--rf4-bg-elevated);
  border-color: #8fb84a;
  box-shadow: inset 0 0 0 1px rgba(184, 217, 110, 0.35);
}

.skill-tree-node:disabled,
.skill-tree-node--locked {
  cursor: default;
  opacity: 0.72;
}

.skill-tree-node-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.32;
  color: var(--rf4-text);
  flex: 1;
  min-width: 0;
}

.skill-tree-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
}

.skill-tree-ring {
  display: block;
  width: 56px;
  height: 56px;
}

.skill-tree-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.28rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #c5dc6a;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.skill-tree-ring-wrap--filled .skill-tree-ring-num {
  color: #2a3118;
  text-shadow: none;
}

.skill-tree-ring-wrap--passive .skill-tree-ring-num {
  color: #c5dc6a;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.skill-tree-ring-lock {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
}

.skills-ability-detail {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--rf4-bg);
  border-left: 1px solid var(--rf4-border);
}

.skill-ability-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem 1.05rem 0.65rem;
}

.skill-ability-footer {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.05rem 1rem;
  border-top: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
}

.skill-ability-hint {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--rf4-text-muted);
}

.skill-ability-reset-btn {
  flex-shrink: 0;
  padding: 0.42rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.skill-ability-reset-btn:hover {
  color: #f85149;
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.08);
}

.skill-ability-title {
  margin: 0 0 0.8rem;
  padding-bottom: 0.6rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.35;
  border-bottom: 1px solid var(--rf4-border);
}

.skill-ability-desc-label {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6a8f2e;
  letter-spacing: 0.02em;
}

html[data-theme="dark"] .skill-ability-desc-label {
  color: #c5dc6a;
}

.skill-ability-desc {
  margin: 0 0 1.05rem;
  font-size: 0.86rem;
  line-height: 1.52;
  color: var(--rf4-text-soft);
}

.skill-ability-levels {
  display: flex;
  flex-direction: column;
  padding: 0.15rem 0 0.35rem 0.1rem;
}

.skill-ability-level {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.8rem;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 0.38rem 0;
  min-height: 2.9rem;
}

.skill-ability-level-badge {
  position: relative;
  z-index: 1;
  width: 2.65rem;
  height: 2.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  border-radius: 50%;
  border: none;
  cursor: default;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.skill-ability-level-badge--done {
  background: radial-gradient(circle at 32% 28%, #dce99a 0%, #b8d96e 52%, #93ad4a 100%);
  color: #1a2112;
  cursor: pointer;
}

.skill-ability-level-badge--done:hover {
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 2px rgba(184, 217, 110, 0.35);
}

.skill-ability-level-badge--next {
  background: radial-gradient(circle at 32% 28%, #9aa3ad 0%, #7a828c 52%, #656d76 100%);
  color: #fff;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 700;
}

.skill-ability-level-badge--next:hover:not(:disabled) {
  filter: brightness(1.08);
}

.skill-ability-level-badge--next:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.skill-ability-level-badge--future {
  background: radial-gradient(circle at 32% 28%, #d0d7de 0%, #afb8c1 52%, #8c959f 100%);
  color: #656d76;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.7;
}

html[data-theme="dark"] .skill-ability-level-badge--next {
  background: radial-gradient(circle at 32% 28%, #7a828c 0%, #565d66 52%, #434a53 100%);
  color: var(--rf4-text);
}

html[data-theme="dark"] .skill-ability-level-badge--future {
  background: radial-gradient(circle at 32% 28%, #6a717a 0%, #4f565f 52%, #3f464f 100%);
  color: #9aa3ad;
  opacity: 0.55;
}

.skill-ability-level-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.42;
  color: var(--rf4-text);
}

.skill-ability-level-text--muted {
  color: var(--rf4-text-muted);
}

.skill-ability-soon {
  margin: 0;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  font-style: italic;
}

.skill-card--active {
  border-color: rgba(184, 217, 110, 0.55);
  box-shadow: 0 0 0 1px rgba(184, 217, 110, 0.2);
}

.skill-card-open-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: inherit;
  color: inherit;
  font: inherit;
}

.skill-card-open-btn:focus-visible {
  outline: 2px solid #b8d96e;
  outline-offset: 2px;
}

.skills-header {
  margin-bottom: 0.25rem;
}

.skills-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
  max-width: 52rem;
}

.skills-toolbar {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.skills-toolbar-block {
  min-width: 0;
}

.skills-toolbar-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skills-level-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.skills-level-input {
  width: 4.5rem;
  padding: 0.45rem 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
}

.skills-level-input:focus {
  border-color: #b8d96e;
  outline: none;
  box-shadow: 0 0 0 2px rgba(184, 217, 110, 0.2);
}

.skills-pool-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.skills-pool-stat {
  font-size: 0.88rem;
  color: var(--rf4-text-muted);
}

.skills-pool-stat strong {
  color: var(--rf4-text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.skills-pool-stat--free strong {
  color: #b8d96e;
}

.skills-slots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.skills-slot-select {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
}

.skills-slot-name {
  flex: 1 1 120px;
  min-width: 100px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
}

.skills-slot-name:focus,
.skills-slot-select:focus {
  border-color: #b8d96e;
  outline: none;
}

.skills-slot-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--rf4-border);
  cursor: pointer;
  white-space: nowrap;
}

.skills-slot-btn--save {
  color: var(--rf4-text);
  background: rgba(184, 217, 110, 0.15);
  border-color: rgba(184, 217, 110, 0.45);
}

.skills-slot-btn--save:hover {
  background: rgba(184, 217, 110, 0.25);
}

.skills-slot-btn--delete {
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
}

.skills-slot-btn--delete:hover:not(:disabled) {
  color: #f85149;
  border-color: rgba(248, 81, 73, 0.45);
}

.skills-slot-btn--reset {
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
}

.skills-slot-btn--reset:hover {
  color: #f85149;
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.08);
}

.skills-slot-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.skills-confirm-modal {
  z-index: 2600;
}

.skills-confirm-modal .modal-content {
  max-width: 420px;
  padding: 1.25rem 1.35rem 1.15rem;
}

.skills-confirm-title {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.skills-confirm-text {
  margin: 0 0 1.15rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--rf4-text-muted);
  white-space: pre-line;
}

.skills-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn-danger {
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.45);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-danger:hover {
  background: rgba(248, 81, 73, 0.25);
  border-color: rgba(248, 81, 73, 0.65);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-content: flex-start;
}

.skill-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 232px;
  width: 232px;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 268px;
  padding: 1rem 0.85rem 0.8rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 3px;
  color: var(--rf4-text);
  box-shadow: 0 1px 2px var(--rf4-shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.skill-card:hover {
  border-color: #8fb84a;
  box-shadow: 0 2px 8px var(--rf4-shadow);
}

.skill-card-icon-btn {
  display: flex;
  justify-content: center;
  margin: 0 auto 0.55rem;
  padding: 0;
  pointer-events: none;
}

.skill-card-open-btn:hover .skill-card-icon-img {
  filter: brightness(1.08);
}

.skill-card-icon-img {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.skill-card-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: var(--rf4-text);
  text-transform: uppercase;
}

.skill-card-line {
  height: 2px;
  margin: 0 0 0.85rem;
  background: var(--rf4-border);
  border-radius: 1px;
  overflow: hidden;
}

.skill-card-line-fill {
  height: 100%;
  background: linear-gradient(90deg, #8fb84a 0%, #b8d96e 100%);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.skill-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
  text-align: left;
}

.skill-card-stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.15rem;
}

.skill-card-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rf4-text);
  font-variant-numeric: tabular-nums;
}

.skill-card-stat-value--muted {
  color: var(--rf4-text-muted);
  font-weight: 500;
}

.skill-card-level-row {
  display: none;
}

.skill-card-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rf4-border);
  text-align: center;
}

.skill-card-points-label {
  display: block;
  font-size: 0.68rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.15rem;
}

.skill-card-points-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--rf4-text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.skill-card-free {
  font-size: 0.75rem;
  color: #b8d96e;
  margin-top: 0.15rem;
}

.skill-card-reset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.skill-card-reset-label {
  font-size: 0.62rem;
  color: var(--rf4-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skill-card-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 4px;
  cursor: not-allowed;
  opacity: 0.65;
}

.skill-card-reset-coin {
  color: #e3b341;
}

@media (max-width: 1100px) {
  .skills-category-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .skills-ability-detail {
    border-left: none;
    border-top: 1px solid var(--rf4-border);
    max-height: 46vh;
  }

  .skills-tree-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .skills-tree-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .skills-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .skill-card {
    flex: 1 1 calc(50% - 0.425rem);
    width: auto;
    min-width: 0;
    max-width: calc(50% - 0.425rem);
  }
}

@media (max-width: 400px) {
  .skill-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* --------------------------------------------
   6) LOCATIONS
   -------------------------------------------- */
.locations-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex-shrink: 0;
}

/* —— Вкладка «Актуальные точки» —— */
.tab-content-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.feed-page-head {
  flex-shrink: 0;
}

.feed-page-head-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feed-page-title {
  margin: 0;
  flex: 1 1 auto;
}

.feed-page-sub {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--rf4-text-muted);
}

#panelFeed .today-feed-refresh {
  margin-left: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.feed-page-body {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 1rem;
  align-items: stretch;
}

.today-feed-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feed-filters-sidebar {
  flex: 0 0 220px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feed-filters-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  flex: 1;
  padding: 0.75rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
}

.feed-filters-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.feed-filters-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.feed-filter-reset {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  color: var(--rf4-accent);
  background: transparent;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
}

.feed-filter-reset:hover {
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-accent);
}

.feed-filter-reset--inline {
  display: inline;
  margin-left: 0.25rem;
  vertical-align: baseline;
}

.feed-top-fish-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.feed-top-fish-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.feed-top-fish-btn:hover {
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-border);
}

.feed-top-fish-btn.is-active {
  background: rgba(88, 166, 255, 0.12);
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.feed-top-fish-thumb {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
  background: var(--rf4-bg-muted);
}

.feed-top-fish-thumb--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.feed-top-fish-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-top-fish-cnt {
  flex-shrink: 0;
  min-width: 1.5rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border-radius: 999px;
  text-align: center;
}

.feed-top-fish-btn.is-active .feed-top-fish-cnt {
  color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.15);
}

.feed-top-fish-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

@media (max-width: 900px) {
  .feed-page-body {
    flex-direction: column;
    gap: 0.65rem;
  }

  .feed-filters-sidebar {
    flex: 0 0 auto;
    order: -1;
  }

  .feed-filters-panel {
    padding: 0.6rem 0.65rem;
    gap: 0.4rem;
  }

  .feed-top-fish-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.4rem;
    padding-bottom: 0.15rem;
  }

  .feed-top-fish-btn {
    flex: 0 0 auto;
    width: auto;
    max-width: 200px;
    padding: 0.35rem 0.55rem;
  }
}

.today-feed-scroll--page {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.today-feed-list--page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
  width: 100%;
  padding-bottom: 1rem;
}

.feed-vk-card {
  width: 100%;
  max-width: 520px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.feed-vk-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem 0.55rem;
}

.feed-vk-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.feed-vk-head-text {
  min-width: 0;
  flex: 1;
}

.feed-vk-author {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.25;
}

.feed-vk-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.12rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

.feed-vk-loc {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--rf4-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feed-vk-dot {
  opacity: 0.6;
}

.feed-vk-time {
  color: var(--rf4-text-muted);
}

.feed-vk-photos {
  position: relative;
  background: var(--rf4-bg);
  border-top: 1px solid var(--rf4-bg-muted);
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.feed-vk-photos--multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.feed-vk-photo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--rf4-bg);
  cursor: pointer;
}

.feed-vk-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(75vh, 720px);
  object-fit: contain;
  background: var(--rf4-bg);
}

.feed-vk-photos--multi .feed-vk-photo {
  max-height: 180px;
}

.feed-vk-photo-more {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.feed-vk-no-photo {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.25;
  background: var(--rf4-bg);
  border-top: 1px solid var(--rf4-bg-muted);
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.feed-vk-body {
  padding: 0.75rem 0.85rem 0.35rem;
}

.feed-vk-fish {
  font-size: 0.9rem;
  font-weight: 600;
  color: #3fb950;
  margin-bottom: 0.25rem;
}

.feed-vk-coords {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--rf4-accent);
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.feed-vk-text {
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--rf4-text-soft);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
}

.feed-vk-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem 0.75rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.feed-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-soft);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.feed-react-btn:hover {
  border-color: var(--rf4-border);
  background: #2d333b;
}

.feed-react-btn.is-active {
  border-color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.15);
}

.feed-react-emoji {
  line-height: 1;
  font-size: 1.05em;
}

.feed-react-cnt {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rf4-text-muted);
}

.feed-react-btn.is-active .feed-react-cnt {
  color: var(--rf4-accent);
}

.today-feed-list--page .today-feed-item {
  width: auto;
  flex: unset;
}

.today-feed-list--page .today-feed-loading,
.today-feed-list--page .today-feed-empty,
.today-feed-list--page .today-feed-error {
  grid-column: 1 / -1;
  white-space: normal;
}

.today-feed-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.today-feed-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rf4-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.today-feed-meta {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.today-feed-refresh {
  margin-left: auto;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.today-feed-refresh:hover {
  color: var(--rf4-text-soft);
  border-color: var(--rf4-border);
}

.today-feed-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--rf4-border) var(--rf4-bg-elevated);
}

.today-feed-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.55rem;
  min-width: min-content;
}

.today-feed-loading,
.today-feed-empty,
.today-feed-error {
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.today-feed-item {
  flex: 0 0 auto;
  width: min(300px, 78vw);
  padding: 0.55rem 0.65rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.today-feed-item:hover {
  border-color: var(--rf4-accent);
  background: var(--rf4-bg-muted);
}

.today-feed-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.today-feed-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rf4-accent);
  white-space: nowrap;
}

.today-feed-loc {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  cursor: pointer;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 2px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-feed-loc:hover {
  color: var(--rf4-accent);
}

.today-feed-coords {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--rf4-text);
  margin-bottom: 0.15rem;
}

.today-feed-fish {
  font-size: 0.78rem;
  color: #3fb950;
  margin-bottom: 0.15rem;
}

/* Лента «Актуальные точки» — только вертикальный скролл (не карусель) */
#panelFeed.tab-panel.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#panelFeed .tab-content-inner.tab-content-feed {
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

#panelFeed .today-feed-main .today-feed-scroll,
#panelFeed .today-feed-main .today-feed-scroll--page {
  flex: 1;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#panelFeed .today-feed-list,
#panelFeed .today-feed-list--page,
#panelFeed #todayFeedList {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 1rem;
  min-width: 0 !important;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

#panelFeed .feed-page-title {
  font-size: 1.28rem;
}

#panelFeed .today-feed-list--page .today-feed-loading,
#panelFeed .today-feed-list--page .today-feed-empty,
#panelFeed .today-feed-list--page .today-feed-error {
  font-size: 0.92rem;
}

#panelFeed .feed-vk-card {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
}

#panelFeed .feed-vk-photos:not(.feed-vk-photos--multi) .feed-vk-photo {
  width: 100%;
  height: auto;
  max-height: min(75vh, 720px);
  object-fit: contain;
}

.today-feed-snippet {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cards-scroll-wrap {
  margin-bottom: 0.5rem;
}

.cards-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 0 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cards-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Своя полоса 30px — в WebView2 системный скролл почти не меняется по CSS */
.cards-hscroll {
  height: 30px;
  padding: 3px 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.cards-hscroll-track {
  position: relative;
  height: 24px;
  background: var(--rf4-bg-muted);
  border-radius: 12px;
  cursor: pointer;
}

.cards-hscroll-thumb {
  position: absolute;
  left: 0;
  top: 0;
  height: 24px;
  min-width: 56px;
  background: var(--rf4-border);
  border-radius: 12px;
  cursor: grab;
  transition: background 0.15s ease;
}

.cards-hscroll-thumb:hover {
  background: var(--rf4-text-muted);
}

.cards-hscroll-thumb:active {
  cursor: grabbing;
  background: var(--rf4-text-muted);
}

.cards-hscroll.is-hidden {
  display: none;
}

.cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  padding: 0.25rem 0.5rem 0.25rem 0;
  width: max-content;
}

.card {
  flex: 0 0 230px;
  scroll-snap-align: start;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--rf4-accent);
}

.card.active {
  border-color: #238636;
  box-shadow: 0 0 0 2px rgba(35, 134, 54, 0.3);
}

.card-new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #f85149;
  border-radius: 12px;
}

.card-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
  background: var(--rf4-bg-muted);
  display: block;
}

.card-body {
  padding: 1rem;
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.card-price-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card-price-label {
  color: var(--rf4-text-muted);
}

.card-price-value {
  font-weight: 700;
  color: var(--rf4-accent);
  padding: 0.15rem 0.5rem;
  background: rgba(88, 166, 255, 0.12);
  border-radius: 6px;
}

.card-house {
  display: inline-flex;
  align-items: center;
  color: #e6b800;
}
.card-house-icon {
  display: block;
  flex-shrink: 0;
}

.card-stats {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-stat-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-stat-label {
  min-width: 4.5em;
  color: var(--rf4-text-muted);
}

.card-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
}

.card-star {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
}

.card-star-full {
  color: #d4a024;
}

.card-star-empty {
  color: var(--rf4-border);
}

.card-star-half {
  position: relative;
  display: inline-block;
  color: var(--rf4-border);
}

.card-star-half .card-star-half-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: #d4a024;
  pointer-events: none;
}

/* --------------------------------------------
   7) DETAIL SECTION
   -------------------------------------------- */
.detail-section {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  overflow: hidden;
  container-type: size;
  container-name: detail-section;
}

/* Общая загрузка при переключении локации (карта + точки) */
.detail-section-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--rf4-loading-scrim);
  border-radius: 12px;
  transition: opacity 0.2s ease;
}

.detail-section-loading.visible {
  display: flex;
}

.detail-section-loading .rf4-fishing-loader-host {
  min-height: 100%;
}

.detail-section-loading-text {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
}

/* Блок карты — только карта и точки на ней, без обводки */
.detail-map-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
  padding: 0;
}

.detail-map-container {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.detail-map-wrap {
  position: relative;
  flex-shrink: 0;
  width: min(50vw, 50vh, 480px);
  height: min(50vw, 50vh, 480px);
  max-width: 100%;
  max-height: 100%;
  min-width: 240px;
  min-height: 240px;
  background: var(--rf4-bg-elevated);
  border-radius: 12px;
  overflow: hidden;
}

/* Достаточно места: карта слева (квадрат), список — от карты до правого края */
@container detail-section (min-width: 720px) and (min-height: 380px) {
  .detail-section {
    width: 100%;
    gap: 0.75rem;
  }

  .detail-map-panel {
    flex: 0 0 auto;
    flex-grow: 0;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .detail-map-container {
    justify-content: flex-start;
    align-items: center;
  }

  .detail-points-panel {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    max-width: none;
    min-width: 280px;
    align-self: stretch;
  }

  .detail-points-panel .points-filters-bar,
  .detail-points-panel .points-block,
  .detail-points-panel .points-list {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .detail-points-panel .points-block {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .detail-map-wrap {
    width: min(100cqh, 58cqw, 920px);
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    max-height: 100%;
  }

  /* Крупнее маркеры на большой карте */
  .map-points-overlay .map-dot {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-width: 2.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  }

  .map-points-overlay .map-dot:hover {
    transform: scale(1.2);
  }

  /* Список точек справа — крупнее и читабельнее */
  .detail-points-panel .points-list {
    gap: 0.85rem;
    padding: 8px 0 20px 0;
  }

  .detail-points-panel .point-card {
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
  }

  .detail-points-panel .spot-summary-card {
    padding: 1rem 0 1rem var(--points-pad-x);
  }

  .detail-points-panel .spot-summary-date-col {
    font-size: 0.9rem;
  }

  .detail-points-panel .points-summary-caption {
    font-size: 0.95rem;
  }

  .detail-points-panel .point-card .coords {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: var(--rf4-accent);
  }

  .detail-points-panel .point-card .fish {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.2rem;
  }

  .detail-points-panel .point-card-text {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: calc(1.35em * 3);
  }

  .detail-points-panel .point-card-date {
    font-size: 0.9rem;
  }
}

/* Запасной вариант, если container queries не сработали */
@media (min-width: 900px) and (min-height: 500px) {
  #panelMain .detail-section {
    width: 100%;
    gap: 0.75rem;
  }

  #panelMain .detail-map-panel {
    flex: 0 0 auto;
    flex-grow: 0;
  }

  #panelMain .detail-map-container {
    justify-content: flex-start;
  }

  #panelMain .detail-points-panel {
    flex: 1 1 0%;
    min-width: 0;
    max-width: none;
  }

  #panelMain .detail-points-panel .points-filters-bar,
  #panelMain .detail-points-panel .points-block,
  #panelMain .detail-points-panel .points-list {
    width: 100%;
    max-width: none;
  }
}

.detail-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: none;
  background: var(--rf4-bg-muted);
}

.detail-map.visible {
  display: block;
}

.map-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
  text-align: center;
  z-index: 1;
}

.map-points-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.map-points-overlay .map-dot {
  pointer-events: auto;
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: #f85149;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, visibility 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.map-points-overlay .map-dot:hover {
  transform: scale(1.25);
  background: var(--rf4-accent);
  border-color: var(--rf4-accent);
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.7);
  z-index: 2;
}

.map-points-overlay .map-dot.active {
  background: var(--rf4-accent);
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--rf4-accent);
}

/* Подсветка точки на карте при наведении на карточку в списке */
.map-points-overlay .map-dot.map-dot-highlight {
  background: var(--rf4-accent);
  border-color: #fff;
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 0 14px rgba(88, 166, 255, 0.95);
}

.map-points-overlay.map-points-hover-focus .map-dot:not(.map-dot-highlight):not(.map-dot-manual) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.85);
}

.point-card.point-card-map-hover {
  border-color: var(--rf4-accent);
  border-left-color: var(--rf4-accent);
  outline: 1px solid rgba(88, 166, 255, 0.35);
  outline-offset: 0;
}

/* Координаты при наведении мыши на карту (снизу слева) */
.map-coords-display {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: monospace;
  font-weight: 600;
  color: var(--rf4-accent);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-accent);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 3;
}

/* Подсказка о точности координат — левый верхний угол карты */
.map-coords-accuracy-notice {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  pointer-events: none;
}

.map-coords-accuracy-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #d29922;
  background: var(--rf4-loading-scrim);
  border: 1px solid #d29922;
  border-radius: 50%;
  cursor: help;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.map-coords-accuracy-btn:hover,
.map-coords-accuracy-btn:focus-visible {
  color: #fff;
  background: rgba(210, 153, 34, 0.35);
  border-color: #e3b341;
  outline: none;
}

.map-coords-accuracy-tip {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(280px, calc(100vw - 2rem));
  padding: 0.65rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  font-weight: 400;
  color: var(--rf4-text);
  text-align: left;
  background: rgba(13, 17, 23, 0.97);
  border: 1px solid #d29922;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.map-coords-accuracy-notice:hover .map-coords-accuracy-tip,
.map-coords-accuracy-notice:focus-within .map-coords-accuracy-tip,
.map-coords-accuracy-notice.is-open .map-coords-accuracy-tip {
  opacity: 1;
  visibility: visible;
}

.detail-map-toolbar {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  pointer-events: auto;
}

.detail-map-ruler-btn {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--rf4-text);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.detail-map-ruler-btn:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--rf4-accent);
}

.detail-map-layer-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--rf4-border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  background: var(--rf4-loading-scrim, rgba(13, 17, 23, 0.82));
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* display:flex выше перебивает нативный [hidden] — без этого кнопка всегда видна */
.detail-map-layer-btn[hidden] {
  display: none !important;
}

.detail-map-layer-btn:hover {
  background: rgba(88, 166, 255, 0.18);
  border-color: var(--rf4-accent);
}

.detail-map-layer-btn:active {
  transform: scale(0.96);
}

.detail-map-layer-btn-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.92;
  filter: brightness(0) invert(1);
}

html[data-theme="light"] .detail-map-layer-btn-icon {
  filter: none;
  opacity: 0.85;
}

.detail-map-wrap--depth .detail-map {
  object-fit: cover;
}

/* Панель фильтров — один ряд; «От/До» на 2-й строке, если не влезают */
.points-filters-bar {
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 0.5rem var(--points-pad-x);
  margin: 0;
  background: linear-gradient(180deg, var(--rf4-bg-muted) 0%, var(--rf4-bg-muted) 100%);
  border-bottom: 1px solid var(--rf4-border);
  box-sizing: border-box;
  container-type: inline-size;
  container-name: points-filters;
  scrollbar-gutter: stable;
}

.points-filters-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--points-date-col);
  column-gap: 0.35rem;
  align-items: end;
}

.points-filters-row:not(:has(.points-summary-caption:not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
}

.points-summary-caption {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0 var(--points-date-inset-r) 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-align: right;
  line-height: 1.3;
  box-sizing: border-box;
  white-space: nowrap;
}

.points-summary-caption[hidden] {
  display: none !important;
}

.points-filters-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  grid-column: 1;
  min-width: 0;
}

.points-filter-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 1 auto;
  min-width: 0;
}

.points-filters-grid > .points-filter-item:first-child {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 240px;
}

.points-filters-grid.points-filters-grid--flat > .points-filter-item:first-child[hidden],
.points-filters-grid.points-filters-grid--flat #filterSpotFilterItem {
  display: none !important;
}

.points-filters-grid.points-filters-grid--flat > .points-filter-item:not([hidden]) {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 240px;
}

.points-filter-row-dates {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
}

.points-filter-row-dates .points-filter-item {
  flex: 0 0 auto;
  gap: 0.3rem;
  min-width: 0;
}

.points-filter-row-dates .points-filter-label {
  flex: 0 0 auto;
  min-width: 1.4rem;
}

.points-filter-item.points-filter-reset-wrap {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex: 0 0 auto;
  align-self: center;
}

@container points-filters (max-width: 520px) {
  .points-filter-row-dates {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .points-filters-grid > .points-filter-item:first-child {
    flex: 1 1 auto;
    max-width: none;
  }
}

.points-filter-label {
  flex: 0 0 36px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--rf4-text-muted);
  margin: 0;
}

.points-filter-date {
  flex: 0 0 auto;
  width: auto;
  min-width: 7.25rem;
  max-width: 9.5rem;
  color: var(--rf4-text);
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.points-filter-date:hover {
  border-color: var(--rf4-border);
}

.points-filter-date:focus {
  border-color: var(--rf4-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.25);
}

.points-filter-date::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  opacity: 0.9;
  cursor: pointer;
}

.points-filter-date::-webkit-datetime-edit {
  color: var(--rf4-text);
}

.rf4-date-ru-wrap {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.rf4-date-ru-visible {
  font-variant-numeric: tabular-nums;
}

.rf4-date-ru-visible.rf4-date-invalid {
  border-color: #f85149 !important;
  box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.25);
}

.rf4-date-ru-visible::placeholder {
  color: var(--rf4-text-muted);
  opacity: 1;
}

/* Выпадающий список «Рыба» */
.points-fish-dropdown {
  position: relative;
  min-width: 90px;
  flex: 1 1 auto;
  max-width: 100%;
}
.points-fish-dropdown-trigger {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--rf4-text);
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.points-fish-dropdown-trigger:hover {
  border-color: var(--rf4-border);
}
.points-fish-dropdown-trigger::after {
  content: "▼";
  font-size: 0.6rem;
  opacity: 0.75;
  margin-left: 0.4rem;
}

.points-fish-dropdown-list,
.records-combo-list {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 2px;
  min-width: 100%;
  max-height: 280px;
  overflow-y: scroll;
  overflow-x: hidden;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}
.points-fish-dropdown-list[aria-hidden="true"],
.records-combo-list[aria-hidden="true"] {
  display: none;
}
.points-fish-dropdown-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #ffffff;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.points-fish-dropdown-option:hover {
  background: #1a1a1a;
}
.points-fish-dropdown-option:focus {
  outline: none;
  background: #1a1a1a;
}

.points-reset-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  background: transparent;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.points-reset-btn:hover {
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-accent);
}

/* Блок точек с ВК — панель справа от карты */
.detail-points-panel {
  flex: 1;
  min-width: 300px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  --points-date-col: clamp(6.75rem, 34%, 10.5rem);
  --points-pad-x: 0.85rem;
  --points-date-inset-r: 0.45rem;
}

.points-panel-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--rf4-text-muted);
  font-weight: 500;
}

.points-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 var(--points-pad-x) 1rem;
  overflow: hidden;
}

.points-list .point-card.list-item-scroll-focus,
.admin-submission-card.list-item-scroll-focus,
.admin-hidden-item.list-item-scroll-focus {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 1px;
}

.points-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 5px 0 20px 0;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-muted);
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto;
  scrollbar-color: var(--rf4-text-muted) var(--rf4-bg-muted);
  scrollbar-gutter: stable;
}

.points-list-loading {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 1.25rem;
}

.points-list-loading--inline {
  flex: 1 1 0%;
  min-height: 0;
}

.points-list-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.points-list-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--rf4-border);
  border-top-color: var(--rf4-accent);
  border-radius: 50%;
  animation: points-list-spin 0.8s linear infinite;
}

@keyframes points-list-spin {
  to { transform: rotate(360deg); }
}

.points-list-loading-text {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.points-list-load-more-hint {
  flex: 0 0 auto;
  padding: 0.65rem 0.75rem 0.25rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
}

.main-share-block {
  flex-shrink: 0;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rf4-border);
}

.main-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 0.85rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.main-share-btn:hover {
  color: var(--rf4-text);
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
}

.main-share-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.main-share-btn-icon {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.9;
}

.main-add-point-btn {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.12);
  border-color: #3fb950;
}

.main-add-point-btn:hover {
  color: #56d364;
  background: rgba(63, 185, 80, 0.22);
  border-color: #56d364;
}

.points-block-header {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.points-block-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--rf4-accent);
}

/* --------------------------------------------
   8) TROPHIES
   -------------------------------------------- */
.trophies-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.trophies-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trophies-filter-label {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  font-weight: 500;
}

.trophies-loc-dropdown {
  min-width: 12rem;
  max-width: min(280px, 42vw);
}

.trophies-filter-select {
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 120px;
}

.trophies-filter-search {
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 180px;
}

.trophies-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.trophies-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.trophies-table th,
.trophies-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.trophies-table th {
  position: sticky;
  top: 0;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 600;
}

.th-name {
  min-width: 180px;
}

.th-rarity {
  min-width: 100px;
}

.th-weight {
  min-width: 80px;
}

.td-name {
  color: var(--rf4-text);
  font-weight: 500;
}

.td-rarity {
  color: var(--rf4-text-muted);
}

.td-weight {
  color: var(--rf4-text);
}

.trophies-empty {
  padding: 2rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
}

/* --------------------------------------------
   9) RECORDS
   -------------------------------------------- */
.records-head {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.records-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.records-head-history-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.records-by-lake-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--rf4-accent);
  background: transparent;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.records-by-lake-btn:hover {
  border-color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.08);
}

.records-back-archive-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.records-back-archive-btn:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.records-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  overflow: hidden;
}

.records-mode-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border: none;
  cursor: pointer;
}

.records-mode-btn:hover {
  color: var(--rf4-text);
  background: var(--rf4-border);
}

.records-mode-btn.active {
  color: #fff;
  background: #238636;
}

.records-open-filters-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.records-open-filters-btn:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.records-history-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.records-classic-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.records-history-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
}

.records-history-stat strong {
  color: var(--rf4-accent);
  font-weight: 700;
}

.records-history-stat-hint {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.records-history-chips-title {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.records-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.records-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  cursor: pointer;
}

.records-history-chip:hover {
  border-color: var(--rf4-accent);
}

.records-history-chip.active {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.records-history-chip .records-history-chip-count {
  color: var(--rf4-text-muted);
  font-size: 0.75rem;
}

.records-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.records-history-search-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  max-width: 420px;
}

.records-history-quick-search {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
}

.records-history-toolbar-clear-btn {
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-text);
  background: var(--rf4-border);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.records-history-toolbar-clear-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-text-muted);
}

.records-history-toolbar-clear-btn:active {
  background: var(--rf4-bg-muted);
}

.records-history-toolbar-date {
  min-width: 118px;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}

.records-history-date-range {
  flex-shrink: 0;
}

.records-history-page-info {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.records-history-pagination {
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
}

.records-pg-btn {
  min-width: 2.1rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.8rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
}

.records-pg-btn:hover:not(:disabled) {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.records-pg-btn-current {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
  cursor: default;
}

.records-pg-btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.records-pg-dots {
  padding: 0 0.15rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  user-select: none;
}

.records-history-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.records-history-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--rf4-loading-scrim);
  border-radius: 8px;
  pointer-events: auto;
}

.records-history-loading.visible {
  display: flex;
}

.records-history-loading .rf4-fishing-loader-host {
  min-height: 100%;
}

.records-history-table {
  font-size: 0.8rem;
  border-collapse: separate;
  border-spacing: 0;
}

.tab-content-records .records-history-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--rf4-bg-muted);
  background-clip: padding-box;
  box-shadow: 0 1px 0 0 var(--rf4-border);
}

.tab-content-records .records-history-table tbody td {
  position: relative;
  z-index: 0;
  background: var(--rf4-bg-elevated);
}

.tab-content-records .records-history-table tbody tr:hover td {
  background: rgba(48, 54, 61, 0.35);
}

.tab-content-records .records-table th,
.tab-content-records .records-table td {
  text-align: center;
  vertical-align: middle;
}

.rec-th-narrow {
  white-space: nowrap;
  font-size: 0.72rem;
}

.records-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  visibility: hidden;
}

.records-drawer.open {
  pointer-events: auto;
  visibility: visible;
}

.records-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.records-drawer.open .records-drawer-backdrop {
  opacity: 1;
}

.records-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  max-width: 100%;
  height: 100%;
  background: var(--rf4-bg);
  border-left: 1px solid var(--rf4-border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.records-drawer.open .records-drawer-panel {
  transform: translateX(0);
}

.records-drawer-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--rf4-border);
}

.records-drawer-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.records-drawer-close {
  width: 2rem;
  height: 2rem;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--rf4-text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.records-drawer-close:hover {
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
}

.records-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.records-drawer-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}

.records-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.records-drawer-field .records-filter-input,
.records-drawer-field .records-filter-date {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.records-drawer-fieldset {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
}

.records-drawer-legend {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  padding: 0 0.35rem;
}

.records-prefix-checks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 200px;
  overflow-y: auto;
}

.records-prefix-checks label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--rf4-text);
  cursor: pointer;
}

.records-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.records-clear-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
}

.records-clear-btn:hover {
  border-color: #f85149;
  color: #f85149;
}

.records-history-table .rec-td-sm {
  font-size: 0.78rem;
  max-width: 8rem;
  word-break: break-word;
}

.records-history-table .rec-td-fish-points,
.records-table .rec-td-fish-points {
  cursor: pointer;
  color: var(--rf4-accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.records-history-table .rec-td-fish-hub,
.records-table .rec-td-fish-hub {
  cursor: default;
  color: inherit;
  text-decoration: none;
}

.records-history-table .rec-td-fish-points:hover,
.records-table .rec-td-fish-points:hover {
  color: var(--rf4-accent);
}

.records-history-table .rec-td-fish-hub .rec-fish-hub-name:hover {
  color: var(--rf4-accent);
}

.records-filters-block {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow-x: hidden;
}

.records-filters-block-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin-bottom: 0.75rem;
}

.records-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.records-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

/* Дата от / до — всегда в одной строке, текст прилегает к полям */
.records-filter-date-range {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.records-filter-label {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.records-filter-input {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 100px;
}

.records-combo-wrap {
  position: relative;
}

.records-combo-wrap .records-combo-list {
  z-index: 1300;
}

.records-combo {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.records-filter-date {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  min-width: 140px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
}
.records-filter-date::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  opacity: 1;
  cursor: pointer;
  width: 18px;
  height: 18px;
}
.records-filter-date::-webkit-datetime-edit {
  color: var(--rf4-text);
}
.records-filter-date:focus {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.records-apply-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: #fff;
  background: #238636;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.records-apply-btn:hover {
  background: #2ea043;
}

.records-toolbar {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.records-breadcrumb {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
}

.records-breadcrumb a {
  color: var(--rf4-accent);
  text-decoration: none;
}

.records-breadcrumb a:hover {
  text-decoration: underline;
}

.records-breadcrumb span {
  color: var(--rf4-text-muted);
  margin: 0 0.35rem;
}

.records-back-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: var(--rf4-accent);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.records-back-btn:hover {
  background: var(--rf4-border);
  color: var(--rf4-accent);
}

.records-loc-nav-toggle {
  display: inline-flex;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--rf4-bg-elevated);
}

.records-loc-nav-btn {
  padding: 0.38rem 0.65rem;
  border: 0;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.records-loc-nav-btn:hover {
  color: var(--rf4-text-soft);
  background: var(--rf4-bg-muted);
}

.records-loc-nav-btn.active {
  background: var(--rf4-border);
  color: var(--rf4-accent);
}

.records-search-row {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.records-search-input {
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  width: 100%;
  max-width: 280px;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
}

.records-summary-line {
  font-size: 0.95rem;
  color: var(--rf4-text-muted);
}

.records-summary-line .records-toolbar-value {
  color: var(--rf4-accent);
  font-weight: 700;
}

.records-toolbar-total {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  margin-right: 0.5rem;
}

.records-toolbar-value {
  font-size: 0.9rem;
  color: var(--rf4-text);
  font-weight: 500;
}

.records-table-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.records-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.records-empty {
  flex-shrink: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.records-table th,
.records-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.records-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 600;
  box-shadow: 0 1px 0 0 var(--rf4-border);
}

.rec-th {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 600;
}

.rec-td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
  color: var(--rf4-text);
}

.rec-td-weight {
  font-weight: 500;
  color: var(--rf4-text);
}

.rec-td-bait {
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
}

.rec-td-nickname.rec-td-nickname-copy,
.rec-td-nickname.rec-td-nickname-filter {
  cursor: pointer;
  color: var(--rf4-accent);
}

.rec-td-nickname.rec-td-nickname-copy:hover,
.rec-td-nickname.rec-td-nickname-filter:hover {
  text-decoration: underline;
  color: var(--rf4-accent);
}

.records-row-clickable {
  cursor: pointer;
}

.records-row-clickable:hover {
  background: rgba(48, 54, 61, 0.5);
}

.rec-th-actions,
.rec-td-actions {
  width: 86px;
  text-align: right;
}

.rec-points-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.rec-points-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.records-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  background: var(--rf4-bg-elevated);
  border: 1px dashed var(--rf4-border);
  border-radius: 12px;
  margin-top: 0.5rem;
}

.records-detail-caption {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  margin-top: 0.25rem;
}

/* --------------------------------------------
   10) REELS
   -------------------------------------------- */
.reels-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reels-compare-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.reels-compare-btn:hover:not(:disabled) {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.reels-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reels-filters-block {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.reels-filters-block-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  margin-bottom: 0.5rem;
}

.reels-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.reels-filter-label {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.reels-filter-select {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 100px;
}

.reels-filter-num {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  width: 80px;
}

.reels-filter-input.reels-search-name {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 160px;
}

.reels-filters-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.reels-filters-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.reels-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.reels-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.reels-table th,
.reels-table td {
  padding: 0.45rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.reels-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 600;
  box-shadow: 0 1px 0 0 var(--rf4-border);
}

.reels-th-check {
  width: 44px;
  min-width: 44px;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.reels-th-img { width: 44px; }
.reels-th-name { width: 18%; }
.reels-th-brand { width: 10%; }
.reels-th-cat { width: 10%; }
.reels-th-size { width: 6%; }
.reels-th-drag { width: 7%; }
.reels-th-mech { width: 5%; max-width: 68px; }
.reels-th-price-silver { width: 8%; }
.reels-th-price-gold { width: 8%; }

.reels-th-sortable {
  cursor: pointer;
  user-select: none;
}

.reels-th-sortable:hover {
  color: var(--rf4-accent);
}

.reels-th-sortable.sorted-asc::after {
  content: " \2191";
  font-size: 0.75rem;
  color: var(--rf4-accent);
}

.reels-th-sortable.sorted-desc::after {
  content: " \2193";
  font-size: 0.75rem;
  color: var(--rf4-accent);
}

.reels-td-img {
  width: 48px;
  padding: 0.35rem;
  vertical-align: middle;
}

.reels-td-name {
  font-weight: 500;
  color: var(--rf4-text);
}

.gear-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
}

.gear-meta-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}

.gear-meta-icon--brand {
  width: 20px;
  height: 20px;
}

.gear-meta-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.gear-meta-letter--cat {
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.28);
  color: var(--rf4-accent);
}

.gear-meta-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reels-td-brand,
.reels-td-cat,
.rods-td-brand,
.rods-td-type {
  max-width: 140px;
}

.reels-td-check {
  width: 44px;
  min-width: 44px;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.reels-td-mech {
  text-align: right;
  white-space: nowrap;
}

.reels-compare-check {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--rf4-accent);
  vertical-align: middle;
}

.reels-th-price-silver {
  min-width: 70px;
  text-align: right;
}

.reels-th-price-gold {
  min-width: 70px;
  text-align: right;
  color: #d4af37;
}

.reels-td-price-silver {
  text-align: right;
  color: var(--rf4-text-muted);
}

.reels-td-price-gold {
  text-align: right;
  color: #d4af37;
}

.reels-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
}

.reels-empty {
  padding: 2rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
}

.reels-compare-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  padding: 1rem;
  box-sizing: border-box;
}

.reels-compare-modal.open {
  display: flex;
}

.reels-compare-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin-bottom: 1rem;
}

.reels-compare-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.reels-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.reels-compare-table thead th {
  min-height: 120px;
}

.reels-compare-param-col {
  padding: 0.65rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--rf4-bg-muted);
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 500;
  min-width: 140px;
}

.reels-compare-reel-col {
  padding: 0;
  text-align: center;
  border-bottom: 1px solid var(--rf4-bg-muted);
  color: var(--rf4-text);
  min-width: 140px;
  background: var(--rf4-bg-muted);
  vertical-align: top;
}

.reels-compare-reel-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  position: relative;
  padding: 0.5rem 2rem 0.5rem 0.5rem;
  min-height: 100px;
  height: 100%;
  box-sizing: border-box;
}

.reels-compare-reel-remove {
  position: absolute;
  top: 0.15rem;
  right: 0;
  padding: 0.2rem 0.45rem;
  font-size: 1rem;
  line-height: 1;
  color: #f85149;
  background: transparent;
  border: 1px solid var(--rf4-border);
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0;
}

.reels-compare-reel-remove:hover {
  background: var(--rf4-bg-muted);
}

.reels-compare-thumb {
  width: 100%;
  flex: 1;
  min-height: 60px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--rf4-bg-elevated);
  display: block;
}

.reels-compare-reel-name {
  font-weight: 500;
  color: var(--rf4-text);
}

.reels-compare-param-name {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  text-align: center;
}

.reels-compare-cell {
  padding: 0.65rem 1rem;
  color: var(--rf4-text);
  text-align: center;
}

.reels-compare-cell-leading {
  background: rgba(35, 134, 54, 0.28);
  color: #3fb950;
  font-weight: 600;
}

.reels-compare-cell-gold {
  color: #d4af37 !important;
}

.gear-detail-cell-highlight {
  background: rgba(35, 134, 54, 0.28);
  color: #3fb950;
  font-weight: 600;
}

.gear-detail-cell-price-silver {
  color: var(--rf4-text-soft);
  font-weight: 600;
}

.gear-detail-param-highlight {
  color: #3fb950;
  font-weight: 600;
}

.reels-compare-empty {
  padding: 1rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------
   11) RODS (mirror of reels)
   -------------------------------------------- */
.rods-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rods-compare-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.rods-compare-btn:hover:not(:disabled) {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.rods-compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rods-filters-block {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.rods-filters-block-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  margin-bottom: 0.5rem;
}

.rods-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.rods-filter-label {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.rods-filter-select {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 100px;
}

.rods-filter-num {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  width: 80px;
}

.rods-filter-input.rods-search-name {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  min-width: 160px;
}

.rods-filters-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.rods-filters-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.rods-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.rods-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.rods-table th,
.rods-table td {
  padding: 0.4rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--rf4-bg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.rods-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 600;
  box-shadow: 0 1px 0 0 var(--rf4-border);
  white-space: nowrap;
}

.rods-th-check {
  width: 44px;
  min-width: 44px;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.rods-th-img { width: 64px; }
.rods-th-name { width: 14%; }
.rods-th-brand { width: 10%; }
.rods-th-type { width: 8%; }
.rods-th-power { width: 8%; }
.rods-th-sensitivity { width: 7%; }
.rods-th-stiffness { width: 8%; }
.rods-th-durability { width: 7%; }
.rods-th-price-silver { width: 8%; }
.rods-th-price-gold { width: 8%; }

.rods-th-sortable {
  cursor: pointer;
  user-select: none;
}

.rods-th-sortable:hover {
  color: var(--rf4-accent);
}

.rods-th-sortable.sorted-asc::after {
  content: " \2191";
  font-size: 0.75rem;
  color: var(--rf4-accent);
}

.rods-th-sortable.sorted-desc::after {
  content: " \2193";
  font-size: 0.75rem;
  color: var(--rf4-accent);
}

.rods-td-img {
  width: 48px;
  padding: 0.35rem;
  vertical-align: middle;
}

.rods-td-name {
  font-weight: 500;
  color: var(--rf4-text);
}

.rods-td-check {
  width: 44px;
  min-width: 44px;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.rods-compare-check {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--rf4-accent);
  vertical-align: middle;
}

.rods-th-price-silver {
  min-width: 70px;
  text-align: right;
}

.rods-th-price-gold {
  min-width: 70px;
  text-align: right;
  color: #d4af37;
}

.rods-td-price-silver {
  text-align: right;
  color: var(--rf4-text-muted);
}

.rods-td-price-gold {
  text-align: right;
  color: #d4af37;
}

.rods-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
}

.rods-empty {
  padding: 2rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
}

.rods-compare-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.rods-compare-modal.open {
  display: flex;
}

.rods-compare-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin-bottom: 1rem;
}

.rods-compare-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.rods-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.rods-compare-table thead th {
  min-height: 120px;
}

.rods-compare-param-col {
  padding: 0.65rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--rf4-bg-muted);
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-muted);
  font-weight: 500;
  min-width: 140px;
}

.rods-compare-rod-col {
  padding: 0;
  text-align: center;
  border-bottom: 1px solid var(--rf4-bg-muted);
  color: var(--rf4-text);
  min-width: 140px;
  background: var(--rf4-bg-muted);
  vertical-align: top;
}

.rods-compare-rod-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  position: relative;
  padding: 0.5rem 2rem 0.5rem 0.5rem;
  min-height: 100px;
  height: 100%;
  box-sizing: border-box;
}

.rods-compare-rod-remove {
  position: absolute;
  top: 0.15rem;
  right: 0;
  padding: 0.2rem 0.45rem;
  font-size: 1rem;
  line-height: 1;
  color: #f85149;
  background: transparent;
  border: 1px solid var(--rf4-border);
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0;
}

.rods-compare-rod-remove:hover {
  background: var(--rf4-bg-muted);
}

.rods-compare-thumb {
  width: 100%;
  flex: 1;
  min-height: 60px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--rf4-bg-elevated);
  display: block;
}

.rods-compare-rod-name {
  font-weight: 500;
  color: var(--rf4-text);
}

.rods-compare-param-name {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  text-align: center;
}

.rods-compare-cell {
  padding: 0.65rem 1rem;
  color: var(--rf4-text);
  text-align: center;
}

.rods-compare-cell-leading {
  background: rgba(35, 134, 54, 0.28);
  color: #3fb950;
  font-weight: 600;
}

.rods-compare-cell-gold {
  color: #d4af37 !important;
}

.rods-compare-empty {
  padding: 1rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------
   12) MODALS
   -------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
}

.modal.open,
.modal.visible {
  display: flex;
}

/* Модалка поста (точка) всегда поверх рекордов/других модалок */
.post-modal {
  z-index: 1100;
}

/* Точка из карточки рыбы — поверх окна энциклопедии */
.post-modal.post-modal-over-encyclopedia {
  z-index: 1400;
}

/* Точка из сводки состязания — поверх окна состязания */
.post-modal.post-modal-over-contest {
  z-index: 1400;
}

/* Точка из профиля (заявки) — поверх окна профиля */
.post-modal.post-modal-over-user-profile {
  z-index: 2700;
}

/* Подтверждения (удаление точки и т.д.) — поверх окна точки и лайтбокса */
.modal.skills-confirm-modal {
  z-index: 3000;
}

/* Энциклопедия из поста/точки — поверх окна поста (.modal { z-index: 1000 } иначе перебивает) */
.modal.encyclopedia-fish-modal {
  z-index: 1300;
}

.modal-content {
  position: relative;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.reels-compare-modal-content {
  width: 94vw;
  height: 92vh;
  max-width: none;
  min-width: 520px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: auto;
  border-radius: 14px;
  padding: 1.5rem;
  box-sizing: border-box;
}

.gear-detail-modal-content {
  width: auto;
  max-width: min(640px, 94vw);
  min-width: 420px;
  height: auto;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: auto;
  border-radius: 14px;
  padding: 1.5rem;
  box-sizing: border-box;
  resize: both;
  overflow: auto;
}

.gear-detail-modal .reels-compare-table-wrap {
  flex: 0 0 auto;
  overflow: visible;
}

.gear-detail-modal .reels-compare-table thead th {
  min-height: auto;
}

.gear-detail-modal .reels-compare-reel-header {
  min-height: 72px;
}

.gear-detail-modal .reels-compare-thumb {
  min-height: 48px;
  max-height: 96px;
}

.rods-compare-modal-content {
  width: 92%;
  max-width: 960px;
  min-width: 520px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Модалка «Измерение расстояния» (линейка на карте) */
.distance-ruler-modal {
  padding: 0.5rem;
}

.distance-ruler-modal-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(94vw, 720px);
  height: min(94vh, 920px);
  max-width: 94vw;
  max-height: 94vh;
  padding: 1.25rem 1.5rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.distance-ruler-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
  text-align: center;
  flex-shrink: 0;
}

.distance-ruler-hint {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  text-align: center;
  flex-shrink: 0;
  line-height: 1.45;
}

.distance-ruler-inputs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  justify-content: center;
  flex-shrink: 0;
}

.distance-ruler-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.distance-ruler-input-label {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  min-width: 4.5rem;
}

.distance-ruler-input {
  width: 120px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-family: monospace;
  color: var(--rf4-text);
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
}

.distance-ruler-input:focus {
  border-color: var(--rf4-accent);
  outline: none;
}

.distance-ruler-map-area {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 0 0.75rem 0;
  container-type: size;
  container-name: distance-ruler-map;
}

.distance-ruler-map-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: min(100cqw, 100cqh, 72vmin);
  height: auto;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 0;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  overflow: hidden;
}

.distance-ruler-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.distance-ruler-map-wrap.is-panning .distance-ruler-overlay {
  cursor: grabbing;
}

.distance-ruler-map-wrap.can-pan .distance-ruler-overlay {
  cursor: grab;
}

.distance-ruler-zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.distance-ruler-zoom-btn {
  pointer-events: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  color: var(--rf4-text);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.distance-ruler-zoom-btn:hover:not(:disabled) {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.distance-ruler-zoom-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

@supports not (container-type: size) {
  .distance-ruler-map-wrap {
    width: min(100%, 72vmin, calc(94vh - 240px));
  }
}

.distance-ruler-map-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.distance-ruler-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.distance-ruler-line-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.distance-ruler-line-svg line {
  stroke: rgba(88, 166, 255, 0.75);
  stroke-width: 0.55;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px rgba(88, 166, 255, 0.35));
}

.distance-ruler-map-wrap.can-pan .distance-ruler-line-svg line {
  stroke: rgba(88, 166, 255, 0.55);
  stroke-width: 0.45;
}

.distance-ruler-point {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  opacity: 0.72;
}

.distance-ruler-point-1 {
  background: rgba(88, 166, 255, 0.55);
}

.distance-ruler-point-2 {
  background: rgba(35, 134, 54, 0.55);
}

.distance-ruler-preview {
  background: rgba(88, 166, 255, 0.4);
  border-style: dashed;
  pointer-events: none;
  opacity: 0.6;
}

/* При увеличении карты — точки ещё меньше и прозрачнее, чтобы не заслонять воду */
.distance-ruler-map-wrap.can-pan .distance-ruler-point {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-width: 1px;
  opacity: 0.48;
  box-shadow: none;
}

.distance-ruler-map-wrap.can-pan .distance-ruler-point-1 {
  background: rgba(88, 166, 255, 0.42);
}

.distance-ruler-map-wrap.can-pan .distance-ruler-point-2 {
  background: rgba(35, 134, 54, 0.42);
}

.distance-ruler-map-wrap.can-pan .distance-ruler-preview {
  opacity: 0.38;
  background: rgba(88, 166, 255, 0.3);
}

.distance-ruler-coords-display {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: monospace;
  font-weight: 600;
  color: var(--rf4-accent);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-accent);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.distance-ruler-result {
  padding: 0.75rem 1rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-family: monospace;
  font-size: 0.9rem;
  width: 100%;
  min-height: 3.5rem;
  box-sizing: border-box;
  flex-shrink: 0;
}

.distance-ruler-coords {
  color: var(--rf4-text-muted);
  margin-bottom: 0.35rem;
}

.distance-ruler-distance {
  color: var(--rf4-accent);
  font-weight: 600;
}

.distance-ruler-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .distance-ruler-modal-content {
    width: 98vw;
    height: 92vh;
    padding: 1rem;
  }

  .distance-ruler-map-area {
    min-height: 200px;
  }
}

.modal-close-btn:hover {
  color: var(--rf4-text);
  background: var(--rf4-border);
}

.new-at-startup-modal .modal-content {
  max-width: 480px;
}

.new-at-startup-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 0.5rem;
}

.new-at-startup-hint {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  margin-bottom: 1rem;
}

.new-at-startup-list {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 5px 5px 20px 0;
}

.new-at-startup-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--rf4-text);
}

.new-at-startup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.whats-new-modal {
  z-index: 1050;
}

.whats-new-modal .modal-content {
  max-width: 520px;
  width: 100%;
  padding: 1.5rem 1.75rem 1.25rem;
}

.whats-new-title {
  margin: 0 2.5rem 0.35rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.whats-new-version {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--rf4-accent);
  font-weight: 600;
}

.whats-new-intro {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--rf4-text-muted);
  line-height: 1.5;
}

.whats-new-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--rf4-text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.whats-new-list li {
  margin-bottom: 0.5rem;
}

.whats-new-list li:last-child {
  margin-bottom: 0;
}

.whats-new-registered-title {
  margin: 1.1rem 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f0b429;
}

.whats-new-list--registered li {
  color: var(--rf4-text);
}

.whats-new-empty {
  margin: 0;
  font-size: 0.95rem;
  color: var(--rf4-text-muted);
  line-height: 1.5;
}

.whats-new-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-border);
}

.post-modal .modal-content {
  width: 80vw;
  height: 80vh;
  max-width: 80vw;
  max-height: 80vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Крестик поверх контента и с увеличенной областью нажатия */
.post-modal .modal-close-btn {
  z-index: 20;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.6rem;
}

.post-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  position: relative;
  padding-right: 3rem;
}

.post-modal-body:has(#postModalEditForm:not([hidden])) {
  overflow-y: auto;
}

/* Текст+карта сверху до линии «Фото», фото всегда снизу */
.post-modal-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  gap: 0.75rem;
}

/* Ряд: слева текст, справа карта — только над блоком «Фото» */
.post-modal-row {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.post-modal-info-wrap {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Сверху: кнопка группы + дата публикации (отступ справа — чтобы не заходить под крестик) */
.post-modal-group-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  padding-right: 0.5rem;
}

.post-modal-group-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.1s;
}

.post-modal-group-link:hover {
  background: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
  transform: translateY(-1px);
}

.post-modal-group-link:active {
  transform: translateY(0);
}

.post-modal-date-top {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  padding: 0.35rem 0.75rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
}

.post-modal-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--rf4-text-soft);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.post-modal-share-btn:hover {
  color: #fff;
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.25);
}

.post-modal-share-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.post-modal-share-btn-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  opacity: 0.95;
}

.post-modal-share-btn-label {
  white-space: nowrap;
}

.post-modal-share-btn--chat {
  border-color: var(--rf4-accent)55;
}

.post-modal-share-btn--chat:hover {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.2);
}

.post-modal-share-btn-chat-icon {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Окно «Поделиться» — поверх модалки поста */
.modal.post-share-modal {
  z-index: 3200;
}

.post-share-modal-content {
  width: min(520px, calc(100vw - 2rem));
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.post-share-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rf4-text);
  padding-right: 2rem;
}

.post-share-modal-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--rf4-text-muted);
}

.post-share-modal-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rf4-text-muted);
}

.post-share-modal-text-body {
  width: 100%;
  max-height: 14rem;
  overflow: auto;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--rf4-text);
  white-space: pre-wrap;
  word-break: break-word;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.post-share-modal-text {
  width: 100%;
  min-height: 8rem;
  max-height: 14rem;
  resize: vertical;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--rf4-text);
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  box-sizing: border-box;
}

.post-share-modal-text:focus {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 1px;
}

.post-share-modal-photos-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-share-modal-photos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.post-share-modal-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.4rem;
  max-height: 160px;
  overflow-y: auto;
}

.post-share-drag-zone {
  margin-top: 0.35rem;
  padding: 0.55rem;
  border: 2px dashed var(--rf4-accent);
  border-radius: 10px;
  background: rgba(56, 139, 253, 0.08);
  transition: border-color 0.2s, background 0.2s;
}

.post-share-drag-zone:hover,
.post-share-drag-zone.is-active {
  border-color: var(--rf4-accent);
  background: rgba(56, 139, 253, 0.14);
}

.post-share-drag-zone-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-accent);
  margin-bottom: 0.45rem;
  text-align: center;
}

.post-share-photo-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  padding: 0.25rem;
  cursor: grab;
}

.post-share-photo-card:active {
  cursor: grabbing;
}

.post-share-photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: var(--rf4-bg);
}

.post-share-modal-hint strong {
  color: var(--rf4-text);
  font-weight: 600;
}

.post-share-modal-actions {
  display: flex;
  margin-top: 0.15rem;
}

.post-share-modal-actions .btn-primary {
  width: 100%;
}

.post-share-modal-footnote {
  margin: 0;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}

/* Ряд: слева текст, справа карта — заменено блоком .post-modal-main выше */
.post-modal-info {
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  user-select: none;
  -webkit-user-select: none;
}

.post-modal-info > :not(.post-modal-text) {
  user-select: none;
  -webkit-user-select: none;
}

.post-modal-meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.post-modal-coords {
  color: var(--rf4-text-muted);
}

.post-modal-fish-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.25rem 0;
}

.post-modal-fish {
  margin: 0;
  color: var(--rf4-accent);
  font-weight: 500;
}

.post-encyclopedia-btn,
.point-encyclopedia-btn {
  flex-shrink: 0;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-accent);
  color: var(--rf4-accent);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.post-encyclopedia-btn:hover,
.point-encyclopedia-btn:hover {
  background: rgba(56, 139, 253, 0.15);
}

.fish-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.fish-row .fish-name {
  flex: 1 1 auto;
}

.point-feed-status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

.point-feed-status.is-actual {
  color: #3fb950;
  background: rgba(46, 160, 67, 0.14);
  border-color: rgba(46, 160, 67, 0.35);
}

.point-feed-status.is-not-actual {
  color: var(--rf4-text-muted);
  background: rgba(139, 148, 158, 0.1);
  border-color: rgba(139, 148, 158, 0.25);
}

.point-feed-status.is-unknown {
  color: var(--rf4-text-muted);
  background: rgba(110, 118, 129, 0.12);
}

.post-modal-fish-row .point-feed-status {
  margin-left: 0;
  margin-top: 0.35rem;
}

.post-modal-date {
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.post-modal-text {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
  -webkit-touch-callout: default;
}

.post-modal-error {
  color: #f85149;
  margin: 0;
}

/* Слот карты: на всю высоту до линии «Фото». Карта = макс. квадрат внутри слота */
.post-modal-map-slot {
  flex: 1 1 48%;
  max-width: 52%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  container-type: size;
}

.post-modal-map-wrap {
  position: relative;
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

@supports (width: 1cqmin) {
  .post-modal-map-wrap {
    width: 100cqmin;
    height: 100cqmin;
    aspect-ratio: auto;
  }
}

.post-modal-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.post-modal-map-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.post-modal-map-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.post-modal-map-wrap.can-pan .post-modal-map-overlay {
  cursor: grab;
}

.post-modal-map-wrap.is-panning .post-modal-map-overlay {
  cursor: grabbing;
}

.post-modal-map-zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.post-modal-map-zoom-controls[hidden] {
  display: none !important;
}

.post-modal-map-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.post-modal-map-point {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: #f85149;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.post-modal-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
  background: var(--rf4-bg-muted);
}

/* Фото — линия, ниже которой карта не заходит */
.post-modal-photos-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 0 auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rf4-border);
  min-width: 0;
}

.post-modal-photos-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 0.25rem;
}

.post-modal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.post-modal-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--rf4-loading-scrim);
  z-index: 5;
}

.post-modal-loading.visible {
  display: flex;
}

.post-modal-loading .rf4-fishing-loader-host {
  min-height: 100%;
  background: transparent;
}

@keyframes post-modal-spin {
  to { transform: rotate(360deg); }
}

.post-modal-photo-card {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.post-modal-photo-card:hover {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
}

.post-modal-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background: #000;
  padding: 0;
}

.lightbox.open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  background: #000;
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  pointer-events: auto;
}

.lightbox-stage.lightbox-dragging {
  cursor: grabbing;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  position: relative;
  z-index: 3;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
  opacity: 0;
}

.lightbox-img.is-ready {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2004;
  width: 52px;
  height: 72px;
  padding: 0;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--rf4-text);
  background: rgba(22, 27, 34, 0.65);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover:not(:disabled) {
  background: rgba(48, 54, 61, 0.9);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.5rem;
  color: var(--rf4-text);
  background: rgba(22, 27, 34, 0.75);
  border: 1px solid var(--rf4-border);
  border-radius: 50%;
  cursor: pointer;
  z-index: 2005;
}

.lightbox-close:hover {
  background: var(--rf4-border);
}

.toast-notify {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 30000;
  padding: 0.75rem 1.25rem;
  background: #238636;
  color: #fff;
  border-radius: 12px;
  transition: transform 0.3s ease;
  visibility: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notify.show {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.toast-notify-inner {
  font-size: 0.95rem;
  font-weight: 500;
}

.notify-form-modal-content {
  width: 520px;
  min-width: 520px;
  max-width: 95vw;
  height: 75vh;
  min-height: 480px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.notify-form-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 1.25rem;
  flex-shrink: 0;
}

.notify-form-open-management-wrap {
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.notify-form-open-management-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  color: var(--rf4-text);
  background: #238636;
  border: 1px solid #2ea043;
  border-radius: 10px;
  cursor: pointer;
}

.notify-form-open-management-btn:hover {
  background: #2ea043;
}


.notify-form-points {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notify-form-points-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 0.75rem;
}

.notify-form-points-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
  background: var(--rf4-bg-elevated);
  border: 1px dashed var(--rf4-border);
  border-radius: 10px;
}

.notify-form-points-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 5px 5px 20px 0;
  -webkit-overflow-scrolling: touch;
}

.notify-items-loc-group {
  margin-bottom: 0.65rem;
}

.notify-items-loc-group:last-child {
  margin-bottom: 0;
}

.notify-items-loc-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  margin: 0;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notify-items-loc-group-head:hover {
  background: #262c36;
  border-color: var(--rf4-border);
}

.notify-items-loc-group-chevron {
  flex: 0 0 auto;
  width: 1rem;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
  line-height: 1;
}

.notify-items-loc-group-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: #3fb950;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notify-items-loc-group-count {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  min-width: 1.4rem;
  text-align: center;
}

.notify-items-loc-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.45rem 0 0.1rem;
}

.notify-items-loc-group--collapsed .notify-items-loc-group-body {
  display: none;
}

.notify-form-point-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  margin: 0;
}

.notify-form-point-content {
  flex: 1;
  font-size: 0.9rem;
  color: var(--rf4-text);
}

.notify-management-modal-content {
  width: 520px;
  min-width: 520px;
  max-width: 95vw;
  height: 75vh;
  min-height: 480px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.notify-management-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 1rem;
  flex-shrink: 0;
}

.notify-management-locations {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

.notify-management-actions {
  flex-shrink: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-border);
  margin-top: 0.5rem;
}

.notify-form-loc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
}

.notify-form-loc-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 0.15rem;
}

.notify-form-loc-label {
  flex: 1;
  min-width: 140px;
  font-size: 0.95rem;
  color: var(--rf4-text);
  cursor: pointer;
}

.notify-form-loc-count {
  font-size: 0.85rem;
  color: var(--rf4-accent);
  margin-left: 0.25rem;
}

.notify-form-fish-toggle {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.notify-form-fish-toggle:hover {
  background: var(--rf4-border);
  color: var(--rf4-accent);
}

.notify-form-fish-wrap {
  width: 100%;
  padding: 0.5rem 0 0 0.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--rf4-border);
}

.notify-form-fish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.notify-form-fish-all-btn,
.notify-form-fish-none-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
  cursor: pointer;
}

.notify-form-fish-all-btn:hover,
.notify-form-fish-none-btn:hover {
  background: var(--rf4-border);
  color: var(--rf4-accent);
}

.notify-form-fish-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  cursor: pointer;
  padding: 0.3rem 0;
}

.notify-form-fish-item input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.records-modal .modal-content {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.records-points-modal .modal-content {
  width: 92vw;
  max-width: 720px;
  max-height: 88vh;
}

.records-points-modal .records-modal-title {
  white-space: normal;
  word-break: break-word;
  padding-right: 2rem;
}

.records-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rf4-text);
  margin: 0 0 1rem;
}

.records-modal-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 5px;
  box-sizing: border-box;
}

.records-modal-empty {
  padding: 2rem;
  text-align: center;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
}

.records-points-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + 20px);
  max-height: 62vh;
  min-height: 140px;
}

.records-points-empty-inner {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.baits-top-list-wrap {
  margin-bottom: 1rem;
}

.baits-top-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.baits-top-item {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  cursor: pointer;
}

.baits-top-item:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

/* --------------------------------------------
   13) POINT CARD
   -------------------------------------------- */
.points-list .point-card {
  flex-shrink: 0;
}

.spot-summary-card {
  border-left-color: var(--rf4-accent);
  padding-left: 0.65rem;
  padding-right: 0;
}

.spot-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--points-date-col);
  column-gap: 0.35rem;
  align-items: start;
}

.spot-summary-main {
  min-width: 0;
}

.spot-summary-top {
  margin-bottom: 0.15rem;
}

.spot-summary-date-col {
  margin: 0;
  padding: 0 var(--points-date-inset-r) 0 0;
  text-align: right;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--rf4-text-soft);
  font-weight: 500;
  line-height: 1.3;
  box-sizing: border-box;
}

.spot-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.spot-summary-count {
  color: #3fb950;
  font-weight: 600;
}

.spot-summary-fish {
  color: var(--rf4-accent);
}

.spot-detail-fish-bar {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
}

.spot-detail-fish-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #3fb950;
  margin-bottom: 0.45rem;
}

.spot-detail-fish-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.spot-detail-fish-chip {
  padding: 0.2rem 0.55rem;
  border: 1px solid #238636;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  color: #7ee787;
  font-size: 0.78rem;
  cursor: pointer;
}

.spot-detail-fish-chip:hover {
  background: var(--rf4-border);
  border-color: #3fb950;
}

.spot-detail-empty {
  padding: 0.75rem 0.25rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.spot-detail-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.35rem 0.15rem 0.55rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--rf4-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rf4-bg-elevated);
}

.spot-detail-loading {
  padding: 0.65rem 0.25rem;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.spots-back-btn {
  margin-right: 0.35rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-accent);
  font-size: 0.8rem;
  cursor: pointer;
}

.spots-back-btn:hover {
  background: var(--rf4-border);
}

.spots-detail-title {
  font-weight: 600;
}

.map-dot-new {
  box-shadow: 0 0 0 2px #238636, 0 0 8px rgba(35, 134, 54, 0.65);
}

.point-card {
  padding: 0.7rem 0.95rem;
  background: var(--rf4-bg-muted);
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  border-left: 4px solid #238636;
  font-size: 0.875rem;
  color: var(--rf4-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.point-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.point-card-new-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #f85149;
  padding: 2px 6px;
  border-radius: 4px;
}

.point-card-new {
  font-weight: 600;
  color: var(--rf4-accent);
}

.point-card-date {
  font-size: 0.85rem;
  color: var(--rf4-text-soft);
  font-weight: 500;
}

.point-card-text {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  max-height: calc(1.35em * 2);
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.point-card-top-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.point-card-diary-btn {
  appearance: none;
  border: 1px solid rgba(35, 134, 54, 0.55);
  background: rgba(35, 134, 54, 0.12);
  color: #3fb950;
  border-radius: 8px;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  flex-shrink: 0;
}

.point-card-diary-btn:hover {
  border-color: #3fb950;
  background: rgba(35, 134, 54, 0.22);
  color: #56d364;
}

.post-modal-share-btn--diary {
  border-color: rgba(35, 134, 54, 0.45);
  color: #3fb950;
}

.post-modal-share-btn--diary:hover {
  border-color: #3fb950;
  color: #56d364;
  background: rgba(35, 134, 54, 0.12);
}

/* --------------------------------------------
   14) SETTINGS
   -------------------------------------------- */
.modal-settings-wrap {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
}

.modal-settings-wrap.open {
  display: flex;
}

.modal-settings-wrap:not(.open) select {
  pointer-events: none;
}

#settingsModal select,
.cafe-watch-select {
  -webkit-appearance: none;
  appearance: none;
}

.cafe-watch-add-modal:not(.open) select {
  pointer-events: none;
}

.settings-modal-content {
  width: min(720px, 96vw);
  height: min(560px, calc(100vh - 2rem));
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--rf4-border);
  display: flex;
  flex-direction: column;
  background: var(--rf4-bg-elevated);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.settings-head {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rf4-border);
}

.settings-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--rf4-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(168px, 200px) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.settings-nav {
  background: var(--rf4-bg);
  border-right: 1px solid var(--rf4-border);
  padding: 0.65rem 0.5rem;
  overflow-y: auto;
  height: 100%;
}

.settings-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.48rem 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rf4-text-soft);
  font-size: 0.86rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-nav-item:hover {
  background: rgba(48, 54, 61, 0.55);
  color: var(--rf4-text);
}

.settings-nav-item.is-active {
  background: rgba(88, 166, 255, 0.15);
  color: var(--rf4-text);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.28);
}

.settings-nav-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
}

.settings-nav-label {
  min-width: 0;
}

.settings-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-content: start;
  overflow: hidden;
  padding: 0;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.settings-panel {
  grid-row: 1;
  grid-column: 1;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.15rem 1.35rem;
  min-height: 0;
  align-self: stretch;
  height: 100%;
  box-sizing: border-box;
  scroll-padding-top: 1.15rem;
}

.settings-panel:not(.is-active) {
  display: none !important;
}

.settings-panel.is-active {
  display: flex;
  flex-direction: column;
  animation: settings-panel-in 0.12s ease-out;
}

@keyframes settings-panel-in {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.settings-panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.settings-panel-desc {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--rf4-text-muted);
}

.settings-panel-desc code {
  font-size: 0.8rem;
  color: var(--rf4-text-soft);
}

.settings-main .settings-dropdown .points-fish-dropdown-trigger {
  min-height: 2.25rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
}

.settings-main .points-fish-dropdown-list {
  z-index: 1105;
}

.settings-subsection {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-border);
}

.settings-subsection:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.settings-subsection-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.settings-subsection-desc {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--rf4-text-muted);
}

.settings-status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.status-card-fixed {
  width: auto;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.status-card-fixed .status-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.status-card-fixed .status-label {
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-card-fixed .status-value {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.status-card-internet,
.status-card-api,
.status-card-game {
  cursor: default;
}

.status-card-game.status-card-launchable {
  cursor: pointer;
}

.status-card-game.status-card-launchable[aria-busy="true"] {
  cursor: wait;
}

.status-card-game:hover {
  border-color: var(--rf4-border);
}

.status-card-game,
.status-card-api {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
}

.status-card.ok .status-value,
.status-card-internet.ok .status-value,
.status-card-game.ok .status-value,
.status-card-api.ok .status-value {
  color: #3fb950;
}

.status-card.err .status-value,
.status-card-internet.err .status-value,
.status-card-game.err .status-value,
.status-card-api.err .status-value {
  color: #f85149;
}

.status-card.ok {
  border-color: #238636;
  background: rgba(35, 134, 54, 0.12);
}

.status-card.err {
  border-color: #da3633;
  background: rgba(218, 54, 51, 0.08);
}

.settings-divider {
  display: none;
}

.settings-body {
  display: none;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(33, 38, 45, 0.85);
}

.settings-row[hidden] {
  display: none !important;
}

.settings-panel .settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 0.9rem;
  color: var(--rf4-text);
}

.settings-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--rf4-text-muted);
}

.settings-nav-tabs-section {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rf4-border);
}

.settings-subsection-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.settings-nav-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-game-firewall-hint {
  margin: 0.15rem 0 0.85rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--rf4-text-muted);
}

.settings-game-firewall-hint code {
  font-size: 0.8rem;
  color: var(--rf4-text-soft);
}

.settings-game-firewall-add.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.settings-game-firewall-meta .settings-game-firewall-exe,
.settings-game-firewall-meta .settings-game-firewall-admin {
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.settings-game-firewall-admin.ok {
  color: #3fb950;
}

.settings-game-firewall-admin.warn {
  color: #d29922;
}

.settings-game-firewall-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.settings-game-firewall-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
}

.settings-game-firewall-item-label {
  font-size: 0.88rem;
  color: var(--rf4-text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.settings-game-firewall-add {
  justify-content: flex-start;
  gap: 0.45rem;
}

.settings-game-firewall-actions {
  margin-bottom: 0.65rem;
}

.settings-label-inline {
  flex: 0 0 auto;
  min-width: auto;
  color: var(--rf4-text-muted);
}

.settings-input-num {
  width: 5.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.88rem;
}

.settings-input-num:focus {
  outline: none;
  border-color: var(--rf4-accent);
}

.settings-sound {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-volume {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}

.settings-volume .range-input-wrap {
  flex: 1;
  min-width: 0;
}

.settings-volume-value {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  min-width: 2.75rem;
  text-align: right;
  flex-shrink: 0;
}

.sound-file-name {
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--rf4-border);
  background: var(--rf4-bg-muted);
  flex-shrink: 0;
}

.tumbler {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.tumbler-track {
  width: 40px;
  height: 22px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tumbler-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--rf4-text-muted);
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.tumbler[aria-checked="true"] .tumbler-track {
  background: rgba(35, 134, 54, 0.3);
  border-color: #238636;
}

.tumbler[aria-checked="true"] .tumbler-thumb {
  transform: translateX(18px);
  background: #238636;
}

@media (max-width: 600px) {
  .settings-modal-content {
    height: min(620px, calc(100vh - 1.5rem));
  }

  .settings-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .settings-nav {
    border-right: none;
    border-bottom: 1px solid var(--rf4-border);
    max-height: 168px;
    flex-shrink: 0;
  }

  .settings-nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
  }

  .settings-main {
    padding: 0;
  }

  .settings-panel.is-active {
    padding: 1rem;
  }

  .settings-status-row {
    grid-template-columns: 1fr;
  }

  .settings-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-row.settings-row-tumbler {
    flex-direction: row;
    align-items: center;
  }

  .settings-volume {
    max-width: none;
  }

  .settings-sound {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
}

/* --------------------------------------------
   15) BUTTONS
   -------------------------------------------- */
.btn-primary {
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: #2ea043;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Base form elements (global) */
input,
select,
textarea {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
}

select {
  cursor: pointer;
  appearance: none;
  background-color: var(--rf4-bg-muted);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.75rem;
}

/* Скрыть стандартные стрелки number input, везде в проекте */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Кастомные стрелки +/- в нашем стиле (для координат и при необходимости других полей) */
.number-spinner-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  overflow: hidden;
}
.number-spinner-wrap .number-spinner-input {
  border: none;
  border-radius: 0;
  padding: 0.35rem 0.5rem;
  width: 4rem;
  min-width: 3rem;
}
.number-spinner-wrap:focus-within {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}
.number-spinner-btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--rf4-border);
}
.number-spinner-btn {
  flex: 1;
  min-height: 14px;
  padding: 0 6px;
  font-size: 0.6rem;
  line-height: 1;
  color: var(--rf4-accent);
  background: var(--rf4-bg-elevated);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.number-spinner-btn:hover {
  background: var(--rf4-border);
  color: var(--rf4-accent);
}
.number-spinner-btn:active {
  background: var(--rf4-bg-muted);
}
.number-spinner-down {
  border-top: 1px solid var(--rf4-border);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--rf4-text-muted);
}

a {
  color: var(--rf4-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Card hover/active states */
.card:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Nav item focus */
.nav-item:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Header notify button focus */
.header-notify-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Modal close button focus */
.modal-close-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Tumbler focus */
.tumbler:focus-visible .tumbler-track {
  box-shadow: 0 0 0 2px var(--rf4-accent);
}

/* Points reset button focus */
.points-reset-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Records apply button focus */
.records-apply-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Reels/Rods compare button focus */
.reels-compare-btn:focus-visible,
.rods-compare-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Reels/Rods table row hover */
.reels-table tbody tr,
.rods-table tbody tr {
  cursor: pointer;
}

.reels-table .reels-td-check,
.rods-table .rods-td-check {
  cursor: default;
}

.reels-table tbody tr:hover,
.rods-table tbody tr:hover {
  background: rgba(33, 38, 45, 0.6);
}

.records-table tbody tr:hover {
  background: rgba(33, 38, 45, 0.6);
}

.trophies-table tbody tr:hover {
  background: rgba(33, 38, 45, 0.6);
}

/* Reels/Rods compare remove button focus */
.reels-compare-reel-remove:focus-visible,
.rods-compare-rod-remove:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Bait button focus */
.records-bait-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Notify form open management button focus */
.notify-form-open-management-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Lightbox close focus */
.lightbox-close:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* New at startup actions button focus */
.new-at-startup-actions .btn-primary:focus-visible,
.new-at-startup-actions .btn-secondary:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.settings-actions .btn-primary:focus-visible,
.settings-actions .btn-secondary:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Baits top item focus */
.baits-top-item:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Notify form fish toggle focus */
.notify-form-fish-toggle:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* Load overlay transition */
.load-overlay-inner .load-text {
  transition: opacity 0.2s ease;
}

/* Game status bar variant when connected */
.game-status-bar.connected .game-status-label {
  color: #238636;
}

.game-status-bar.disconnected .game-status-label {
  color: #f85149;
}

/* Card image loading state */
.card-image[data-loading="true"] {
  background: var(--rf4-bg-muted);
  min-height: 100px;
}

/* Map placeholder when no image */
.detail-map-wrap:not(.has-image) .map-placeholder {
  display: block;
}

.detail-map-wrap.has-image .map-placeholder {
  display: none;
}

/* Points block header icon */
.points-block-header .nav-icon {
  margin-right: 0.35rem;
}

/* Records fish item expanded */
.records-fish-item.expanded .records-fish-item-detail {
  display: block;
}

.records-fish-item:not(.expanded) .records-fish-item-detail {
  display: none;
}

/* Reels/Rods table header resize hint */
.reels-th-sortable.sorted-asc,
.reels-th-sortable.sorted-desc,
.rods-th-sortable.sorted-asc,
.rods-th-sortable.sorted-desc {
  color: var(--rf4-accent);
}

/* Toast variants */
.toast-notify.error {
  background: #f85149;
}

.toast-notify.warning {
  background: #d29922;
}

/* Post modal map point hover */
.post-modal-map-point:hover {
  transform: scale(1.2);
}

/* Point card border variants */
.point-card.new {
  border-left-color: var(--rf4-accent);
}

.point-card.updated {
  border-left-color: #d29922;
}

.records-summary-line strong {
  color: var(--rf4-text);
}

/* Reels/Rods empty state icon */
.reels-empty .icon,
.rods-empty .icon,
.records-empty .icon,
.trophies-empty .icon {
  font-size: 2rem;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

/* --------------------------------------------
   16) SCROLLBARS — кастомный вид, отступ трека от верха/низа 5px
   -------------------------------------------- */
/* Firefox: тонкий скроллбар */
.tab-content-inner,
.records-table-wrap,
.reels-table-wrap,
.rods-table-wrap,
.new-at-startup-list,
.notify-form-points-list,
.settings-nav,
.settings-main,
.trophies-table-wrap,
.reels-compare-table-wrap,
.rods-compare-table-wrap,
.modal-content,
.records-modal-table-wrap,
.notify-management-locations,
.records-points-list,
.points-fish-dropdown-list,
.records-combo-list,
.post-modal-body,
  scrollbar-width: thin;
  scrollbar-color: var(--rf4-border) var(--rf4-bg-muted);
}

.points-fish-dropdown-list,
.records-combo-list {
  scrollbar-color: var(--rf4-border) var(--rf4-bg);
}

.tab-content-inner::-webkit-scrollbar,
.records-table-wrap::-webkit-scrollbar,
.reels-table-wrap::-webkit-scrollbar,
.rods-table-wrap::-webkit-scrollbar,
.new-at-startup-list::-webkit-scrollbar,
.notify-form-points-list::-webkit-scrollbar,
.settings-nav::-webkit-scrollbar,
.settings-main::-webkit-scrollbar,
.trophies-table-wrap::-webkit-scrollbar,
.reels-compare-table-wrap::-webkit-scrollbar,
.rods-compare-table-wrap::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.records-modal-table-wrap::-webkit-scrollbar,
.notify-management-locations::-webkit-scrollbar,
.records-points-list::-webkit-scrollbar,
.points-fish-dropdown-list::-webkit-scrollbar,
.records-combo-list::-webkit-scrollbar,
.post-modal-body::-webkit-scrollbar,
  width: 6px;
  height: 6px;
}

.tab-content-inner::-webkit-scrollbar-button,
.records-table-wrap::-webkit-scrollbar-button,
.reels-table-wrap::-webkit-scrollbar-button,
.rods-table-wrap::-webkit-scrollbar-button,
.new-at-startup-list::-webkit-scrollbar-button,
.notify-form-points-list::-webkit-scrollbar-button,
.settings-nav::-webkit-scrollbar-button,
.settings-main::-webkit-scrollbar-button,
.trophies-table-wrap::-webkit-scrollbar-button,
.reels-compare-table-wrap::-webkit-scrollbar-button,
.rods-compare-table-wrap::-webkit-scrollbar-button,
.modal-content::-webkit-scrollbar-button,
.records-modal-table-wrap::-webkit-scrollbar-button,
.notify-management-locations::-webkit-scrollbar-button,
.records-points-list::-webkit-scrollbar-button,
.points-fish-dropdown-list::-webkit-scrollbar-button,
.records-combo-list::-webkit-scrollbar-button,
.post-modal-body::-webkit-scrollbar-button,
  display: none;
  width: 0;
  height: 0;
}

.tab-content-inner::-webkit-scrollbar-track,
.records-table-wrap::-webkit-scrollbar-track,
.reels-table-wrap::-webkit-scrollbar-track,
.rods-table-wrap::-webkit-scrollbar-track,
.new-at-startup-list::-webkit-scrollbar-track,
.notify-form-points-list::-webkit-scrollbar-track,
.settings-nav::-webkit-scrollbar-track,
.settings-main::-webkit-scrollbar-track,
.trophies-table-wrap::-webkit-scrollbar-track,
.reels-compare-table-wrap::-webkit-scrollbar-track,
.rods-compare-table-wrap::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.records-modal-table-wrap::-webkit-scrollbar-track,
.notify-management-locations::-webkit-scrollbar-track,
.records-points-list::-webkit-scrollbar-track,
.points-fish-dropdown-list::-webkit-scrollbar-track,
.records-combo-list::-webkit-scrollbar-track,
.post-modal-body::-webkit-scrollbar-track,
  /* Трек не вплотную к верху/низу — отступ 5px */
  background: linear-gradient(to bottom, transparent 0, transparent 5px, var(--rf4-bg-muted) 5px, var(--rf4-bg-muted) calc(100% - 5px), transparent calc(100% - 5px));
  border-radius: 4px;
}

.tab-content-inner::-webkit-scrollbar-thumb,
.records-table-wrap::-webkit-scrollbar-thumb,
.reels-table-wrap::-webkit-scrollbar-thumb,
.rods-table-wrap::-webkit-scrollbar-thumb,
.new-at-startup-list::-webkit-scrollbar-thumb,
.notify-form-points-list::-webkit-scrollbar-thumb,
.settings-nav::-webkit-scrollbar-thumb,
.settings-main::-webkit-scrollbar-thumb,
.trophies-table-wrap::-webkit-scrollbar-thumb,
.reels-compare-table-wrap::-webkit-scrollbar-thumb,
.rods-compare-table-wrap::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.records-modal-table-wrap::-webkit-scrollbar-thumb,
.notify-management-locations::-webkit-scrollbar-thumb,
.records-points-list::-webkit-scrollbar-thumb,
.points-fish-dropdown-list::-webkit-scrollbar-thumb,
.records-combo-list::-webkit-scrollbar-thumb,
.post-modal-body::-webkit-scrollbar-thumb,
  background: var(--rf4-border);
  border-radius: 4px;
}

.tab-content-inner::-webkit-scrollbar-thumb:hover,
.records-table-wrap::-webkit-scrollbar-thumb:hover,
.reels-table-wrap::-webkit-scrollbar-thumb:hover,
.rods-table-wrap::-webkit-scrollbar-thumb:hover,
.new-at-startup-list::-webkit-scrollbar-thumb:hover,
.notify-form-points-list::-webkit-scrollbar-thumb:hover,
.settings-nav::-webkit-scrollbar-thumb:hover,
.settings-main::-webkit-scrollbar-thumb:hover,
.trophies-table-wrap::-webkit-scrollbar-thumb:hover,
.reels-compare-table-wrap::-webkit-scrollbar-thumb:hover,
.rods-compare-table-wrap::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.records-modal-table-wrap::-webkit-scrollbar-thumb:hover,
.notify-management-locations::-webkit-scrollbar-thumb:hover,
.records-points-list::-webkit-scrollbar-thumb:hover,
.points-fish-dropdown-list::-webkit-scrollbar-thumb:hover,
.records-combo-list::-webkit-scrollbar-thumb:hover,
.post-modal-body::-webkit-scrollbar-thumb:hover,
  background: var(--rf4-border);
}

.tab-content-inner::-webkit-scrollbar-corner,
.records-table-wrap::-webkit-scrollbar-corner,
.reels-table-wrap::-webkit-scrollbar-corner,
.rods-table-wrap::-webkit-scrollbar-corner,
.new-at-startup-list::-webkit-scrollbar-corner,
.notify-form-points-list::-webkit-scrollbar-corner,
.settings-nav::-webkit-scrollbar-corner,
.settings-main::-webkit-scrollbar-corner,
.trophies-table-wrap::-webkit-scrollbar-corner,
.reels-compare-table-wrap::-webkit-scrollbar-corner,
.rods-compare-table-wrap::-webkit-scrollbar-corner,
.modal-content::-webkit-scrollbar-corner,
.records-modal-table-wrap::-webkit-scrollbar-corner,
.notify-management-locations::-webkit-scrollbar-corner,
.records-points-list::-webkit-scrollbar-corner,
.points-fish-dropdown-list::-webkit-scrollbar-corner,
.post-modal-body::-webkit-scrollbar-corner,
  background: var(--rf4-bg-muted);
  border-radius: 4px;
}

/* Главная: список точек — более толстый скролл */
.points-list::-webkit-scrollbar {
  width: 14px;
}

.points-list::-webkit-scrollbar-thumb {
  background: var(--rf4-border);
  border: 3px solid transparent;
  background-clip: padding-box;
  min-height: 40px;
}

.points-list::-webkit-scrollbar-thumb:hover {
  background: var(--rf4-text-muted);
  background-clip: padding-box;
}

/* Print: hide overlay and sidebar */
@media print {
  .load-overlay {
    display: none !important;
  }

  .sidebar {
    display: none;
  }

  .app-body {
    display: block;
  }

  .main {
    padding: 0.5rem;
  }

  .tab-panel {
    display: block !important;
  }

  .tab-content-inner {
    overflow: visible;
  }

  body {
    background: #fff;
    color: #1f2328;
  }

  .modal {
    display: none !important;
  }

  .header {
    border-bottom-color: #ccc;
  }

  .card {
    border-color: #ddd;
    break-inside: avoid;
  }

  .points-block,
  .detail-map-wrap,
  .detail-map-panel,
  .detail-points-panel {
    break-inside: avoid;
  }

  .reels-table-wrap,
  .rods-table-wrap,
  .records-table-wrap,
  .trophies-table-wrap {
    break-inside: avoid;
  }

  .btn-primary,
  .btn-secondary {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .toast-notify {
    display: none !important;
  }
}

/* --- Руководство пользователя --- */
.tab-content-guide {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.guide-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.guide-page-title {
  margin: 0;
}

.guide-source-link {
  font-size: 0.82rem;
  color: #8bc34a;
  text-decoration: none;
  white-space: nowrap;
}

.guide-source-link:hover {
  color: #c5e1a5;
  text-decoration: underline;
}

.guide-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
  max-width: 56rem;
}

.guide-toolbar {
  display: flex;
  gap: 0.75rem;
}

.guide-search {
  flex: 1;
  max-width: 22rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.9rem;
}

.guide-search:focus {
  outline: 2px solid #3d5a20;
  border-color: #4a6b28;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
  flex: 1;
}

.guide-nav {
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.65rem 0.5rem 0.75rem;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.guide-nav-group + .guide-nav-group {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.guide-nav-group-title {
  margin: 0 0 0.4rem 0.45rem;
  padding-left: 0.45rem;
  border-left: 2px solid #4a6b28;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ccc65;
}

.guide-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.38rem 0.55rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--rf4-text-soft);
  font-size: 0.84rem;
  line-height: 1.35;
  cursor: pointer;
}

.guide-nav-item--sub {
  padding-left: 1rem;
  font-size: 0.8rem;
  color: #9da7b3;
}

.guide-nav-item:hover {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
}

.guide-nav-item.is-active {
  background: #2d3a1f;
  color: #d4e8a8;
}

.guide-main {
  min-width: 0;
  min-height: 0;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  background: linear-gradient(165deg, #1a2118 0%, var(--rf4-bg-elevated) 55%);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.guide-card:hover {
  border-color: #4a6b28;
  transform: translateY(-1px);
}

.guide-card-thumb {
  aspect-ratio: 16 / 7;
  background: var(--rf4-bg);
  overflow: hidden;
}

.guide-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guide-card-body {
  padding: 0.85rem 0.95rem 1rem;
}

.guide-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--rf4-text);
}

.guide-card-meta {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: #8bc34a;
  font-weight: 600;
}

.guide-card-teaser {
  margin: 0;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-back-btn {
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-soft);
  font-size: 0.82rem;
  cursor: pointer;
}

.guide-back-btn:hover {
  border-color: var(--rf4-border);
  color: var(--rf4-text);
}

.guide-article {
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  padding: 1rem 1.15rem 1.25rem;
}

.guide-article-cat {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8bc34a;
}

.guide-article-title {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  color: var(--rf4-text);
}

.guide-article-summary {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #b6c0cc;
  padding: 0.65rem 0.8rem;
  background: var(--rf4-bg);
  border-left: 3px solid #4a6b28;
  border-radius: 0 8px 8px 0;
}

.guide-article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.guide-figure {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
}

.guide-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.guide-zoomable {
  cursor: zoom-in;
}

.guide-zoomable:hover {
  opacity: 0.92;
}

.guide-figure .guide-zoomable {
  transition: opacity 0.15s;
}

.guide-article-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--rf4-text-soft);
}

.guide-article-body p {
  margin: 0 0 0.65rem;
}

.guide-article-body ul,
.guide-article-body ol {
  margin: 0 0 0.75rem 1.1rem;
  padding: 0;
}

.guide-article-body li {
  margin-bottom: 0.35rem;
}

.guide-article-body em {
  color: var(--rf4-text-muted);
  font-size: 0.84rem;
}

.guide-article-body h3,
.guide-article-body h4 {
  margin: 1rem 0 0.45rem;
  padding: 0.45rem 0 0.45rem 0.75rem;
  color: var(--rf4-text);
  font-size: 1.02rem;
  font-weight: 700;
  border-left: 3px solid var(--rf4-accent);
  background: rgba(56, 139, 253, 0.08);
  border-radius: 0 8px 8px 0;
}

.guide-article-body .guide-subhead,
.guide-article-body .guide-step-head {
  margin: 1.1rem 0 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0 8px 8px 0;
}

.guide-article-body .guide-subhead {
  background: rgba(56, 139, 253, 0.1);
  border-left: 3px solid var(--rf4-accent);
}

.guide-article-body .guide-subhead > strong {
  color: var(--rf4-text);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.guide-article-body .guide-step-head {
  background: rgba(184, 217, 110, 0.12);
  border-left: 3px solid #b8d96e;
}

.guide-article-body .guide-step-head > strong {
  color: #ffffff;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.guide-article-body img {
  display: block;
  width: 100%;
  max-width: 825px;
  height: auto;
  border-radius: 8px;
  margin: 0.5rem 0 0.85rem;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
}

.guide-figure--inline {
  margin: 0 0 0.85rem;
  max-width: 825px;
}

.guide-figure--inline img {
  margin: 0;
}

.guide-empty,
.guide-load-error,
.guide-nav-empty {
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-nav {
    max-height: 200px;
  }
}

/* --------------------------------------------
   АККАУНТ (online API)
   -------------------------------------------- */
.account-text-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.9rem;
}

.account-text-input:focus {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 1px;
}

.account-guest-badge {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--rf4-text-soft);
}

.account-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.25rem;
}

.account-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--rf4-text-muted);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

.account-tab.is-active {
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
}

.account-field {
  display: block;
  margin-bottom: 0.75rem;
}

.account-field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: var(--rf4-text-soft);
}

.account-required {
  color: #f85149;
}

.account-field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}

.account-field-status {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.account-field-status.is-checking {
  color: var(--rf4-text-muted);
}

.account-field-status.is-ok {
  color: #3fb950;
}

.account-field-status.is-error {
  color: #f85149;
}

.account-form-error {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #f85149;
  font-size: 0.85rem;
}

.account-submit-btn {
  width: 100%;
}

.account-profile-head {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rf4-border), var(--rf4-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.account-avatar-btn {
  padding: 0;
  border: none;
  cursor: pointer;
}

.account-avatar-btn:hover .account-avatar-edit,
.account-avatar.is-empty .account-avatar-edit {
  opacity: 1;
}

.account-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.account-avatar-host {
  position: relative;
  line-height: 0;
}

.account-avatar-host.has-image:hover .account-avatar-remove {
  opacity: 1;
}

.account-avatar.is-empty {
  background: var(--rf4-bg-muted);
  border: 2px dashed var(--rf4-border);
}

.account-avatar.is-empty .account-avatar-edit {
  background: rgba(0, 0, 0, 0.2);
  font-size: 1.45rem;
}

.account-avatar.is-empty .account-avatar-initial {
  display: none;
}

.account-avatar-remove {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f85149;
  color: #fff;
  border: 2px solid var(--rf4-bg);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 3;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-avatar-remove:hover {
  background: #ff6b63;
}

.account-avatar-hint {
  background: none;
  border: none;
  color: var(--rf4-accent);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-avatar-hint:hover {
  color: var(--rf4-accent);
}

.account-profile-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0.65rem 0 0.85rem;
  border-bottom: none;
}

.account-logout-btn {
  width: auto;
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

.account-delete-btn {
  margin-top: 0.35rem;
  width: auto;
}

.account-avatar.has-image {
  background: var(--rf4-border);
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-avatar-initial {
  line-height: 1;
}

.account-avatar-edit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.account-profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.account-profile-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.account-profile-name-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--rf4-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.account-profile-name-edit:hover {
  color: var(--rf4-accent);
  background: rgba(88, 166, 255, 0.1);
}

.account-profile-name-edit:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.account-profile-nick {
  font-size: 0.88rem;
  color: var(--rf4-accent);
  margin-top: 0.15rem;
}

.account-profile-meta {
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  margin-top: 0.2rem;
}

.account-xp-row {
  margin-bottom: 0.35rem;
}

.account-xp-block {
  margin: 0.35rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: rgba(13, 17, 23, 0.45);
}

.account-xp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.account-xp-progress {
  margin-top: 0.55rem;
}

.account-xp-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  overflow: hidden;
}

.account-xp-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #238636, #3fb950);
  transition: width 0.25s ease;
}

.account-xp-progress-meta {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
}

.account-xp-history {
  margin: 0.25rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
}

.account-xp-history-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.account-xp-history-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.account-xp-history-item strong {
  color: #3fb950;
  font-weight: 600;
}

.daily-reward-streak {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.88rem;
  color: var(--rf4-accent);
}

.post-delete-modal-content {
  max-width: 420px;
}

.post-delete-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.65rem 0;
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
}

.post-delete-note {
  min-height: 72px;
  resize: vertical;
}

.post-delete-reason-dropdown {
  width: 100%;
}

.post-delete-reason-trigger {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  font-size: 0.84rem;
  border-radius: 8px;
}

.admin-modlog-delete-reason {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #d29922;
}

.account-danger-section {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(248, 81, 73, 0.25);
}

.account-danger-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f85149;
}

.account-danger-desc {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
}

.settings-uninstall-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-border);
}

.settings-uninstall-row {
  align-items: center;
}

.settings-uninstall-note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
}

.account-verify-hint {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
}

.account-code-input {
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.account-resend-btn {
  width: 100%;
  margin-top: 0.5rem;
}

.account-password-section {
  margin: 1rem 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.account-nickname-modal {
  z-index: 2600;
}

.account-nickname-modal .modal-content {
  max-width: 400px;
  width: min(400px, 92vw);
  padding: 1.25rem 1.35rem 1.15rem;
}

.account-nickname-modal-title {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.account-nickname-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.account-nickname-form .account-field {
  margin-bottom: 0;
}

.account-password-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: var(--rf4-text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.account-password-toggle:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
}

.account-password-toggle[aria-expanded="true"] .account-password-chevron {
  transform: rotate(180deg);
}

.account-password-chevron {
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--rf4-text-muted);
}

.account-password-form {
  margin-top: 0.75rem;
}

.account-form-success {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.35);
  color: #3fb950;
  font-size: 0.85rem;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-gate.open {
  display: flex;
}

.auth-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.92);
  backdrop-filter: blur(6px);
}

.auth-gate-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  padding: 1.5rem 1.35rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(56, 139, 253, 0.22);
  background: linear-gradient(165deg, #1a2332 0%, var(--rf4-bg) 55%, #0a0e14 100%);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.auth-gate-brand {
  text-align: center;
  margin-bottom: 1.1rem;
}

.auth-gate-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 0.55rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.auth-gate-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--rf4-text);
  letter-spacing: 0.02em;
}

.auth-gate-subtitle {
  display: none;
}

.auth-gate-error {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #f85149;
  font-size: 0.85rem;
}

.auth-gate-error.is-warning {
  background: rgba(210, 153, 34, 0.12);
  border-color: rgba(210, 153, 34, 0.4);
  color: #d29922;
}

.auth-gate-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(48, 54, 61, 0.7);
}

.auth-gate-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 0.88rem;
  cursor: pointer;
}

.auth-gate-tab.is-active {
  background: rgba(56, 139, 253, 0.18);
  color: var(--rf4-accent);
}

.auth-gate-form {
  display: none;
}

.auth-gate-form.is-active {
  display: block;
}

.auth-gate-form-reg .account-field {
  margin-bottom: 0.65rem;
}

.auth-gate-form-reg .account-field-label {
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
  color: #9da7b3;
}

.auth-gate-form-reg .account-text-input {
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
  border-radius: 10px;
  background: var(--rf4-loading-scrim);
  border-color: rgba(48, 54, 61, 0.9);
}

.auth-gate-form-reg .account-text-input:focus {
  border-color: rgba(56, 139, 253, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.15);
}

.auth-gate-form-reg .account-text-input::placeholder {
  color: #5c6670;
  font-size: 0.82rem;
}

.auth-gate-reg-passwords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@media (max-width: 400px) {
  .auth-gate-reg-passwords {
    grid-template-columns: 1fr;
  }
}

.auth-gate-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.1rem 0 0.75rem;
  flex-wrap: wrap;
}

.auth-gate-forgot-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--rf4-accent);
  cursor: pointer;
  text-decoration: none;
}

.auth-gate-forgot-link:hover {
  text-decoration: underline;
  color: var(--rf4-accent);
}

.auth-gate-forgot-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--rf4-text-muted);
}

.auth-gate-back-btn {
  width: 100%;
  margin-top: 0.55rem;
}

.auth-gate-remember {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  cursor: pointer;
}

.auth-gate-remember input {
  accent-color: var(--rf4-accent);
}

.auth-gate-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(48, 54, 61, 0.7);
  text-align: center;
}

.auth-gate-guest-btn {
  width: 100%;
}

.auth-gate-guest-hint {
  display: none;
}

/* ——— Правовая информация ——— */

.legal-consent-note {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(48, 54, 61, 0.55);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--rf4-text-muted);
  text-align: center;
}

.legal-inline-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--rf4-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.legal-inline-link:hover {
  color: var(--rf4-accent);
}

.account-legal-block {
  margin-top: 1.35rem;
  padding: 1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(56, 139, 253, 0.18);
  background: linear-gradient(145deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%);
}

.account-legal-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.account-legal-desc {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--rf4-text-muted);
}

.account-legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.account-legal-btn {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
}

.legal-modal {
  z-index: 12100;
}

.legal-modal .modal-content {
  max-width: min(92vw, 640px);
  width: 100%;
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.5rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(56, 139, 253, 0.22);
  background: linear-gradient(165deg, #1a2332 0%, var(--rf4-bg) 55%, #0a0e14 100%);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.legal-modal-head {
  margin: 0 2.25rem 0.75rem 0;
}

.legal-modal-title {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.legal-modal-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--rf4-accent);
  font-weight: 500;
}

.legal-modal-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: rgba(1, 4, 9, 0.45);
  border: 1px solid rgba(48, 54, 61, 0.8);
}

.legal-modal-tab {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.legal-modal-tab.is-active {
  background: rgba(56, 139, 253, 0.16);
  color: var(--rf4-text);
  box-shadow: 0 0 0 1px rgba(56, 139, 253, 0.28) inset;
}

.legal-modal-tab:hover:not(.is-active) {
  color: var(--rf4-text-soft);
}

.legal-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.35rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rf4-border) transparent;
}

.legal-doc-panel {
  display: none;
}

.legal-doc-panel.is-active {
  display: block;
}

.legal-doc-meta {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.legal-doc-lead {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border-left: 3px solid var(--rf4-accent);
  background: rgba(56, 139, 253, 0.08);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--rf4-text-soft);
}

.legal-doc-section {
  margin-bottom: 1.1rem;
}

.legal-doc-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.legal-doc-section p {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  line-height: 1.58;
  color: #b1bac4;
}

.legal-doc-section p:last-child {
  margin-bottom: 0;
}

.legal-doc-list {
  margin: 0.35rem 0 0.55rem;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  line-height: 1.58;
  color: #b1bac4;
}

.legal-doc-list li {
  margin-bottom: 0.35rem;
}

.legal-doc-list li:last-child {
  margin-bottom: 0;
}

.legal-doc-note {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(35, 134, 54, 0.1);
  border: 1px solid rgba(35, 134, 54, 0.28);
  font-size: 0.84rem;
  line-height: 1.5;
  color: #7ee787;
}

.legal-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.5rem 0 0.75rem;
}

@media (max-width: 520px) {
  .legal-data-grid {
    grid-template-columns: 1fr;
  }
}

.legal-data-card {
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.85);
  background: rgba(13, 17, 23, 0.65);
}

.legal-data-icon {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.legal-data-card strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  color: var(--rf4-text);
}

.legal-data-card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--rf4-text-muted);
}

.legal-discord-link,
.legal-law-link {
  color: var(--rf4-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.legal-discord-link:hover,
.legal-law-link:hover {
  color: var(--rf4-accent);
}

.legal-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(48, 54, 61, 0.8);
  flex-shrink: 0;
}

.auth-gate-form .legal-consent-note {
  margin-bottom: 0;
}

.auth-gate-form-reg .legal-consent-note {
  font-size: 0.72rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.admin-search-input {
  flex: 1 1 10rem;
  width: min(100%, 18rem);
  max-width: 18rem;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text);
  font-size: 0.88rem;
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--rf4-accent);
}

.admin-users-count {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  width: 100%;
}

.admin-user-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
}

.admin-user-avatar {
  flex: 0 0 auto;
}

.admin-user-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg);
  overflow: hidden;
  cursor: pointer;
}

.admin-user-avatar-btn.is-empty {
  cursor: default;
  opacity: 0.85;
}

.admin-user-avatar-btn.has-image:hover {
  border-color: var(--rf4-accent);
}

.admin-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-user-avatar-initial {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rf4-text-muted);
}

.admin-user-main {
  flex: 1 1 12rem;
  min-width: 0;
}

.admin-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.admin-user-card.is-blocked {
  opacity: 0.72;
  border-color: #6e2a2a;
}

.admin-user-card.is-chat-banned {
  border-color: #9e6a2a;
}

.admin-user-card.is-self {
  border-color: var(--rf4-accent)55;
}

.admin-user-identity {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 14rem;
}

.admin-user-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rf4-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-login {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-meta {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  line-height: 1.25;
}

.admin-badge-role-user {
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-border);
  color: var(--rf4-text-muted);
}

.admin-badge-role-moderator {
  background: rgba(56, 139, 253, 0.14);
  border-color: rgba(56, 139, 253, 0.4);
  color: var(--rf4-accent);
}

.admin-badge-role-admin {
  background: rgba(210, 153, 34, 0.16);
  border-color: rgba(210, 153, 34, 0.45);
  color: #e3b341;
}

.admin-badge-blocked {
  background: rgba(248, 81, 73, 0.14);
  border-color: rgba(248, 81, 73, 0.4);
  color: #ff7b72;
}

.admin-badge-chat-banned {
  background: rgba(255, 166, 87, 0.14);
  border-color: rgba(255, 166, 87, 0.4);
  color: #ffa657;
}

.admin-badge-online {
  background: rgba(63, 185, 80, 0.14);
  border-color: rgba(63, 185, 80, 0.4);
  color: #3fb950;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.admin-role-select {
  flex: 0 0 auto;
  width: 8.75rem;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  font-size: 0.82rem;
}

.admin-role-select:disabled {
  opacity: 0.55;
}

.admin-ban-btn {
  flex: 0 0 auto;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.admin-chat-ban-btn {
  flex: 0 0 auto;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.admin-chat-ban-btn.is-unban {
  color: #3fb950;
  border-color: #238636;
}

@media (max-width: 720px) {
  .admin-user-card {
    width: 100%;
    max-width: 24rem;
  }

  .admin-user-identity {
    flex-basis: 100%;
    max-width: none;
  }

  .admin-user-meta {
    flex-basis: 100%;
    white-space: normal;
  }

  .admin-user-actions {
    flex-basis: 100%;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(48, 54, 61, 0.55);
  }
}

@media (max-width: 480px) {
  .admin-user-card {
    max-width: 100%;
  }

  .admin-role-select {
    flex: 1 1 8rem;
    width: auto;
    min-width: 0;
  }

  .admin-ban-btn {
    flex: 1 1 auto;
  }
}

.admin-ban-btn.is-unblock {
  color: #3fb950;
  border-color: #238636;
}

.admin-users-empty {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
  text-align: center;
}

.admin-load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.admin-users-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  padding: 0.65rem 0.25rem 0.35rem;
  background: var(--rf4-bg);
  border-top: 1px solid var(--rf4-border);
  box-shadow: 0 -6px 16px var(--rf4-shadow);
}

.admin-page-btn {
  min-width: 2.25rem;
  padding: 0.35rem 0.55rem;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text);
  border-color: var(--rf4-border);
}

.admin-page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.admin-page-num {
  min-width: 2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text);
  font-size: 0.82rem;
  cursor: pointer;
}

.admin-page-num.is-active {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}

.admin-page-num:disabled {
  opacity: 0.55;
  cursor: default;
}

/* --- Админ: вкладки и журнал модерации --- */
.admin-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0.35rem;
}

.admin-page-head {
  flex-shrink: 0;
  margin-bottom: 0.25rem;
}

.admin-page-desc {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--rf4-text-muted);
}

.admin-section {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-top: 0.15rem;
}

/* Пользователи: список скроллится, пагинация закреплена снизу */
#adminSectionUsers {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#adminSectionUsers .admin-toolbar,
#adminSectionUsers .account-form-error,
#adminSectionUsers .admin-users-empty {
  flex-shrink: 0;
}

#adminSectionUsers .admin-users-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0.35rem;
  scrollbar-color: #afb8c1 var(--rf4-bg-muted);
}

.admin-section[hidden] {
  display: none !important;
}

#adminSectionSupport {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-modlog-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  flex-wrap: wrap;
}

.admin-modlog-tab {
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  border-radius: 8px;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.admin-modlog-tab.is-active {
  background: #1f3a5f;
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.admin-modlog-hidden-desc {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.admin-support-layout {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 0.65rem;
  min-height: 0;
  flex: 1;
  height: calc(100% - 2.2rem);
}

.admin-support-list-col,
.admin-support-thread-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  overflow: hidden;
}

.admin-support-list-col {
  padding: 0.45rem;
}

.admin-support-chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
  margin-top: 0.3rem;
}

.admin-support-chat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--rf4-text);
  cursor: pointer;
}

.admin-support-chat-item:hover {
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.25);
}

.admin-support-chat-item.is-active {
  background: rgba(63, 185, 80, 0.14);
  border-color: rgba(63, 185, 80, 0.4);
}

.admin-support-chat-item.has-unread .admin-support-chat-name {
  color: #56d364;
  font-weight: 700;
}

.admin-support-chat-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-support-chat-preview {
  font-size: 0.7rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.admin-support-chat-meta {
  font-size: 0.65rem;
  color: var(--rf4-text-muted);
}

.admin-support-thread-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
  padding: 0.75rem;
}

.admin-support-thread-empty[hidden],
.admin-support-thread[hidden] {
  display: none !important;
}

.admin-support-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.admin-support-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--rf4-border);
}

.admin-support-thread-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.admin-support-delete-btn {
  color: #ffa198 !important;
  border-color: rgba(248, 81, 73, 0.45) !important;
}

.admin-support-delete-btn:hover {
  background: rgba(248, 81, 73, 0.12) !important;
}

.admin-support-thread-name {
  display: block;
  font-weight: 650;
  color: var(--rf4-text);
  font-size: 0.9rem;
}

.admin-support-thread-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  margin-top: 0.1rem;
}

.admin-support-messages-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
}

.admin-support-messages {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.admin-support-compose {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  padding: 0.5rem 0.65rem 0.6rem;
  border-top: 1px solid var(--rf4-border);
}

.admin-support-compose .chat-compose-input {
  flex: 1;
}

.chat-message--staff .chat-message-bubble {
  border-color: rgba(63, 185, 80, 0.35);
}

.devchat-modal .chat-modal-title {
  color: #3fb950;
}

.nav-item-devchat[hidden],
.nav-item-devchat.is-force-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .admin-support-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .admin-support-list-col {
    max-height: 180px;
  }
  .admin-support-thread-col {
    min-height: 420px;
  }
}

.admin-hidden-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-hidden-item {
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
  padding: 0.65rem 0.75rem;
}

.admin-hidden-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.admin-hidden-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.admin-hidden-item-meta {
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.35rem;
}

.admin-hidden-item-text {
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
  line-height: 1.35;
  margin-bottom: 0.45rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-hidden-item-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.5rem 0 0.85rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.admin-tab {
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.admin-tab.is-active {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #f85149;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.admin-tab-badge[hidden] {
  display: none !important;
}

.admin-tab-panel {
  display: block;
}

.admin-tab-panel[hidden] {
  display: none !important;
}

.admin-catalog-stats {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.admin-catalog-tabs {
  margin-bottom: 0.75rem;
}

.admin-catalog-panel[hidden] {
  display: none !important;
}

.admin-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.admin-catalog-search {
  flex: 1 1 12rem;
  width: auto;
  max-width: none;
}

.admin-catalog-table {
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  overflow: hidden;
}

.admin-catalog-table-head {
  display: grid;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-elevated);
  border-bottom: 1px solid var(--rf4-border);
}

.admin-catalog-table-head-loc {
  grid-template-columns: 4.5rem minmax(0, 1.4fr) minmax(0, 1fr) 5rem;
}

.admin-catalog-table-head-fish {
  grid-template-columns: 4.5rem minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1fr);
}

.admin-catalog-table-body {
  max-height: min(56vh, 560px);
  overflow: auto;
}

.admin-catalog-table-row {
  display: grid;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  font-size: 0.84rem;
}

.admin-catalog-table-row:last-child {
  border-bottom: none;
}

.admin-catalog-table-row-loc {
  grid-template-columns: 4.5rem minmax(0, 1.4fr) minmax(0, 1fr) 5rem;
}

.admin-catalog-table-row-fish {
  grid-template-columns: 4.5rem minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1fr);
}

.admin-catalog-row-actions {
  display: flex;
  gap: 0.25rem;
}

.admin-catalog-icon-btn {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-soft);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.admin-catalog-icon-btn:hover {
  background: var(--rf4-border);
  border-color: var(--rf4-border);
}

.admin-catalog-icon-btn-danger:hover {
  color: #f85149;
  border-color: #f8514966;
}

.admin-catalog-row-title {
  color: var(--rf4-text);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-catalog-row-meta {
  color: var(--rf4-text-muted);
  font-size: 0.78rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-catalog-empty,
.admin-catalog-empty-hint {
  padding: 0.75rem;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
}

.admin-catalog-modal {
  z-index: 12050;
}

.admin-catalog-modal .modal-content {
  width: min(92vw, 32rem);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 1rem 1.1rem 1.1rem;
}

.admin-catalog-modal-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: var(--rf4-text);
}

.admin-catalog-modal-text {
  margin: 0 0 1rem;
  color: var(--rf4-text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.admin-catalog-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.admin-catalog-modal-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.admin-loc-asset-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-loc-asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rf4-border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  background: var(--rf4-bg-elevated, rgba(255, 255, 255, 0.03));
}

.admin-loc-asset-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.admin-loc-asset-preview {
  min-height: 72px;
  border-radius: 8px;
  background: var(--rf4-bg, #0d1117);
  border: 1px dashed var(--rf4-border, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-loc-asset-preview[aria-hidden="true"] {
  display: none;
}

.admin-loc-asset-thumb {
  display: block;
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.admin-loc-asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-loc-asset-delete {
  color: var(--rf4-danger, #f85149);
}

.admin-catalog-field-wide {
  grid-column: 1 / -1;
}

.admin-catalog-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-catalog-field-label {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
}

.admin-catalog-field-input {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: none !important;
}

.admin-catalog-field-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  padding-top: 1.35rem;
}

.admin-catalog-field-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex: 0 0 auto;
}

.admin-catalog-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}

.admin-catalog-hint code {
  font-size: 0.7rem;
  color: var(--rf4-text-muted);
}

.admin-catalog-star-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.admin-catalog-star-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-catalog-star-row-label {
  flex: 0 0 5.5rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.admin-catalog-star-picker {
  position: relative;
  flex: 0 0 auto;
  width: fit-content;
  max-width: fit-content;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.15rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.admin-catalog-star-track {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  flex: 0 0 auto;
  width: fit-content;
}

.admin-catalog-star-picker.is-hovering {
  background: rgba(56, 139, 253, 0.08);
}

.admin-catalog-star-picker.is-locked {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.admin-catalog-star-row.is-locked .admin-catalog-star-row-label {
  color: var(--rf4-text-muted);
}

.admin-catalog-star-track.is-preview .card-star-full,
.admin-catalog-star-track.is-preview .card-star-half .card-star-half-inner {
  color: #f0c14b;
}

.admin-catalog-star-track.is-preview .card-star-empty {
  color: var(--rf4-border);
}

.admin-catalog-star-picker:not(.is-hovering):not(.is-locked) .admin-catalog-star-track .card-star-full,
.admin-catalog-star-picker:not(.is-hovering):not(.is-locked) .admin-catalog-star-track .card-star-half .card-star-half-inner {
  color: #d4a024;
}

.admin-catalog-star-picker:focus-visible {
  outline: 1px solid var(--rf4-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

#adminCatalogLocModalStatsSection .admin-catalog-hint {
  font-size: 0.85rem;
  margin: 0.5rem 0 0.15rem;
}

#adminCatalogLocModalStatsSection .admin-catalog-star-rows {
  gap: 0.75rem;
  margin-top: 0.55rem;
}

#adminCatalogLocModalStatsSection .admin-catalog-star-row {
  gap: 0.85rem;
}

#adminCatalogLocModalStatsSection .admin-catalog-star-row-label {
  flex: 0 0 7.25rem;
  font-size: 0.98rem;
  color: var(--rf4-text-soft);
}

#adminCatalogLocModalStatsSection .admin-catalog-star-picker {
  min-height: 0;
}

#adminCatalogLocModalStatsSection .admin-catalog-star-picker .card-star,
#adminCatalogLocModalStatsSection .admin-catalog-star-track .card-star {
  font-size: 1.5rem;
}

#adminCatalogLocModalStatsSection .admin-catalog-subtitle {
  font-size: 1rem;
}

#adminCatalogLocModalMapSection {
  margin-top: 1.15rem;
  padding-top: 1rem;
}

#adminCatalogLocModalMapSection .admin-catalog-subtitle {
  font-size: 1rem;
  margin-bottom: 0.65rem;
}

#adminCatalogLocModalMapSection .admin-catalog-modal-fields-grid {
  gap: 0.9rem 1.15rem;
  margin-top: 0.35rem;
}

#adminCatalogLocModalMapSection .admin-catalog-field {
  gap: 0.5rem;
}

#adminCatalogLocModalMapSection .admin-catalog-field-label {
  font-size: 0.95rem;
  color: var(--rf4-text-soft);
}

.admin-catalog-modal-section {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.admin-catalog-tag-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.45rem;
}

.admin-catalog-tag-add-row .admin-catalog-field-input {
  flex: 1 1 10rem;
}

.admin-catalog-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}

.admin-catalog-chip {
  max-width: 100%;
}

.admin-catalog-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-catalog-confirm-content {
  width: min(92vw, 24rem) !important;
}

.admin-catalog-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 1rem;
  min-height: 320px;
}

@media (max-width: 900px) {
  .admin-catalog-grid {
    grid-template-columns: 1fr;
  }
}

.admin-catalog-col-list,
.admin-catalog-col-detail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-catalog-form-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
}

.admin-catalog-form-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.admin-catalog-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--rf4-text-soft);
}

.admin-catalog-btn {
  align-self: flex-start;
}

.admin-catalog-input-sm {
  max-width: 7rem;
}

.admin-catalog-url-input {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.admin-catalog-list,
.admin-catalog-fish-list,
.admin-catalog-groups-list {
  flex: 1;
  min-height: 120px;
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
}

.admin-catalog-loc-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--rf4-bg-muted);
  background: transparent;
  color: var(--rf4-text);
  cursor: pointer;
  font-size: 0.85rem;
}

.admin-catalog-loc-item:hover {
  background: var(--rf4-bg-elevated);
}

.admin-catalog-loc-item.is-active {
  background: #1f6feb22;
  border-left: 3px solid var(--rf4-accent);
}

.admin-catalog-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.admin-catalog-detail-head input {
  flex: 1 1 12rem;
}

.admin-catalog-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
}

.admin-catalog-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  font-size: 0.78rem;
  color: var(--rf4-text);
}

.admin-catalog-tag-remove {
  border: none;
  background: transparent;
  color: var(--rf4-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.admin-catalog-tag-remove:hover {
  color: #f85149;
}

.admin-catalog-fish-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(4rem, 0.7fr)) auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  font-size: 0.82rem;
}

.admin-catalog-fish-row input {
  width: 100%;
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  color: var(--rf4-text);
}

.admin-catalog-fish-locs {
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  grid-column: 1 / -1;
}

.admin-catalog-group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  font-size: 0.85rem;
}

.admin-catalog-group-row.is-inactive {
  opacity: 0.55;
}

.admin-modlog-toolbar {
  flex-wrap: wrap;
  align-items: center;
}

.admin-modlog-toolbar-wide {
  width: 100%;
}

.admin-search-input.admin-modlog-search-wide {
  flex: 1 1 auto;
  width: min(100%, 36rem);
  max-width: 36rem;
  min-width: min(100%, 20rem);
}

.admin-modlog-filter,
.admin-modlog-post-id {
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  min-height: 36px;
}

.admin-modlog-post-id {
  width: 110px;
}

.admin-modlog-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.admin-modlog-item {
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg);
  padding: 0.65rem 0.75rem;
}

.admin-modlog-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.admin-modlog-action {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--rf4-border);
  white-space: nowrap;
}

.admin-modlog-action-update { color: var(--rf4-accent); border-color: var(--rf4-accent)66; }
.admin-modlog-action-hide { color: #d29922; border-color: #d2992266; }
.admin-modlog-action-unhide { color: #3fb950; border-color: #3fb95066; }
.admin-modlog-action-delete { color: #f85149; border-color: #f8514966; }

.admin-modlog-time {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.admin-modlog-actor {
  font-size: 0.84rem;
  color: var(--rf4-text);
  margin-bottom: 0.25rem;
}

.admin-modlog-summary {
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.admin-modlog-meta {
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.35rem;
}

.admin-modlog-details {
  margin-top: 0.45rem;
}

.admin-modlog-details > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rf4-accent);
  list-style: none;
}

.admin-modlog-details > summary::-webkit-details-marker {
  display: none;
}

.admin-modlog-details > summary::before {
  content: "▸ ";
  color: var(--rf4-text-muted);
}

.admin-modlog-details[open] > summary::before {
  content: "▾ ";
}

.admin-modlog-diff {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-modlog-diff-title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--rf4-text-muted);
}

.admin-modlog-diff-title--changed {
  color: #9a6700;
}

html[data-theme="dark"] .admin-modlog-diff-title--changed {
  color: #d29922;
}

.admin-modlog-diff-empty {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--rf4-bg-muted);
}

.admin-modlog-diff-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-modlog-diff-list--muted {
  opacity: 0.85;
}

.admin-modlog-diff-row {
  display: grid;
  grid-template-columns: minmax(7rem, 9.5rem) minmax(0, 1fr);
  gap: 0.45rem 0.65rem;
  align-items: start;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
}

.admin-modlog-diff-row--changed {
  border-color: rgba(210, 153, 34, 0.45);
  background: rgba(210, 153, 34, 0.1);
}

.admin-modlog-diff-row--removed {
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.08);
}

.admin-modlog-diff-row--added {
  border-color: rgba(46, 160, 67, 0.4);
  background: rgba(46, 160, 67, 0.08);
}

.admin-modlog-diff-row--same {
  background: var(--rf4-bg);
}

.admin-modlog-diff-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.35;
}

.admin-modlog-diff-values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
}

.admin-modlog-diff-old {
  color: #cf222e;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.95;
}

.admin-modlog-diff-new {
  color: #1a7f37;
  font-weight: 700;
}

.admin-modlog-diff-arrow {
  color: var(--rf4-text-muted);
  font-weight: 700;
}

.admin-modlog-diff-same {
  color: var(--rf4-text-soft);
}

html[data-theme="dark"] .admin-modlog-diff-old {
  color: #ff7b72;
}

html[data-theme="dark"] .admin-modlog-diff-new {
  color: #3fb950;
}

.admin-modlog-diff-same-details,
.admin-modlog-raw-details {
  margin-top: 0.15rem;
}

.admin-modlog-diff-same-details > summary,
.admin-modlog-raw-details > summary {
  cursor: pointer;
  font-size: 0.74rem;
  color: var(--rf4-text-muted);
}

.admin-modlog-json {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.55rem;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

@media (max-width: 640px) {
  .admin-modlog-diff-row {
    grid-template-columns: 1fr;
  }
}

/* --- Модерация точек в модалке поста --- */
.post-modal-moderation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rf4-accent)44;
  border-radius: 10px;
  background: var(--rf4-accent)12;
}

.post-modal-moderation-bar[hidden],
.post-modal-submission-bar[hidden] {
  display: none !important;
}

.post-modal-moderation-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rf4-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-modal-moderation-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-mod-btn {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
}

.post-mod-hide-btn {
  border-color: #d2992255;
  color: #d29922;
}

.post-modal-edit-form {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
}

.post-modal-edit-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
}

.post-modal-edit-hint {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
}

.post-modal-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.post-modal-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.post-modal-edit-field-wide {
  grid-column: 1 / -1;
}

.post-mod-loc-dropdown,
.post-mod-fish-dropdown {
  width: 100%;
}

.post-mod-edit-dropdown-trigger {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.55rem;
  font-size: 0.84rem;
  border-radius: 8px;
  border-color: var(--rf4-border);
}

.post-modal-edit-field input,
.post-modal-edit-field select,
.post-modal-edit-field textarea {
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.84rem;
}

.post-modal-edit-field textarea.post-modal-edit-textarea {
  min-height: 14rem;
  max-height: min(52vh, 32rem);
  resize: vertical;
  line-height: 1.45;
  font-family: inherit;
}

/* При редактировании — чуть больше окно поста, чтобы удобнее читать и править текст */
.post-modal:has(#postModalEditForm:not([hidden])) .modal-content {
  width: 88vw;
  height: 88vh;
  max-width: 88vw;
  max-height: 88vh;
}

.post-modal-edit-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.post-modal-map-inner.is-mod-edit {
  outline: 2px dashed var(--rf4-accent)66;
  outline-offset: -2px;
}

.post-modal-map-wrap.is-mod-edit .post-modal-map-overlay {
  cursor: crosshair;
}

.admin-modlog-restore-row {
  margin-top: 0.45rem;
}

.admin-modlog-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-modlog-panel[hidden] {
  display: none !important;
}

.admin-open-modlog-row {
  margin: 0 0 0.75rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-modlog-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 1.1rem 0;
  flex-shrink: 0;
}

.admin-modlog-tab {
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text-soft);
  border-radius: 8px 8px 0 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: none;
}

.admin-modlog-tab.is-active {
  background: var(--rf4-bg-elevated);
  color: #ffa657;
  border-color: var(--rf4-border);
}

.admin-modlog-panel {
  display: none;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
}

.admin-modlog-panel.is-active {
  display: flex;
}

.admin-modlog-hidden-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

.admin-hidden-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 180px;
  overflow: auto;
}

.admin-hidden-item {
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg);
  padding: 0.65rem 0.75rem;
}

.admin-hidden-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.3rem;
}

.admin-hidden-item-id {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffa657;
}

.admin-hidden-item-meta {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.admin-hidden-item-body {
  font-size: 0.82rem;
  color: var(--rf4-text-soft);
  line-height: 1.45;
  margin-bottom: 0.45rem;
}

.admin-hidden-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* --- User submissions (форма + карта как линейка) --- */
.modal.submission-form-modal,
.modal.submission-notify-modal {
  z-index: 2700;
}

.submission-form-modal {
  padding: 0.5rem;
}

.submission-form-modal-content {
  display: flex;
  flex-direction: column;
  width: 80vw;
  height: 80vh;
  max-width: 80vw;
  max-height: 80vh;
  padding: 1.1rem 1.25rem 0.9rem;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  box-shadow: 0 16px 48px rgba(1, 4, 9, 0.55);
}

.submission-form-header {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  padding-right: 2.5rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.submission-form-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.submission-map-location {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--rf4-accent);
  padding: 0.3rem 0.7rem;
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
}

/* Как у поста: ряд (инфо|карта) до линии «Фото», фото снизу */
.submission-form-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  gap: 0.75rem;
}

.submission-form-row {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.submission-form-info {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
}

.submission-map-slot {
  flex: 1 1 48%;
  max-width: 52%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  container-type: size;
}

.submission-coord-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
}

.submission-coord-row {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
}

.submission-coord-row .distance-ruler-input-label {
  min-width: 0;
  text-align: right;
}

.submission-coord-input {
  width: 100%;
  max-width: 160px;
}

.submission-map-area {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.submission-map-area .distance-ruler-map-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  width: auto;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
}

@supports (width: 1cqmin) {
  .submission-map-slot .distance-ruler-map-wrap,
  .submission-map-area .distance-ruler-map-wrap {
    width: 100cqmin;
    height: 100cqmin;
    aspect-ratio: auto;
    max-width: 100%;
    max-height: 100%;
  }
}

.submission-map-area .submission-map-coords-display {
  top: 8px;
  right: 48px;
  left: auto;
  bottom: auto;
  z-index: 6;
}

.submission-map-area .submission-map-coords-display[aria-hidden="true"] {
  visibility: hidden;
}

/* Пин поста на карте (как точка улова, не кружок линейки) */
.submission-map-point,
.submission-map-preview {
  position: absolute;
  width: 28px;
  height: 36px;
  margin: -34px 0 0 -14px;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
  z-index: 3;
}

.submission-map-point[aria-hidden="true"],
.submission-map-preview[aria-hidden="true"] {
  display: none;
}

.submission-map-point-pin {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: #f85149;
  border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.submission-map-point-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: #fff;
  border-radius: 50%;
  transform: rotate(45deg);
}

.submission-map-point-pulse {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: rgba(248, 81, 73, 0.35);
  animation: submission-map-pin-pulse 1.7s ease-out infinite;
}

@keyframes submission-map-pin-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.7;
  }
  70% {
    transform: scale(2.4);
    opacity: 0;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.submission-map-preview {
  opacity: 0.55;
  z-index: 2;
}

.submission-map-preview .submission-map-point-pin {
  background: var(--rf4-accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.submission-map-area .distance-ruler-map-wrap.can-pan .submission-map-point,
.submission-map-area .distance-ruler-map-wrap.can-pan .submission-map-preview {
  width: 28px;
  height: 36px;
  margin: -34px 0 0 -14px;
  border: none;
  opacity: 1;
  box-shadow: none;
}

.submission-map-result {
  flex-shrink: 0;
  text-align: left;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  margin-top: auto;
}

.submission-notify-modal-content {
  max-width: 520px;
}

.submission-notify-title {
  font-size: 1.15rem;
}

.submission-form-hint {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--rf4-text-muted);
  text-align: center;
  line-height: 1.45;
  flex-shrink: 0;
}

.submission-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.submission-field-text {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0.5rem;
}

.submission-field-text .submission-textarea {
  flex: 1 1 auto;
  min-height: 110px;
  height: 100%;
  resize: vertical;
}

.submission-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rf4-text-muted);
  letter-spacing: 0.02em;
}

.submission-fish-dropdown {
  width: 100%;
}

.submission-fish-trigger {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  font: inherit;
  border-radius: 8px;
  border-color: var(--rf4-border);
}

.submission-text-input,
.submission-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.submission-date-field {
  position: relative;
  margin-bottom: 0.65rem;
}

.submission-date-picker {
  position: relative;
}

.submission-date-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.submission-date-trigger:hover,
.submission-date-trigger[aria-expanded="true"] {
  border-color: var(--rf4-accent);
  background: var(--rf4-bg-elevated);
}

.submission-date-trigger-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.submission-date-trigger-text {
  flex: 1 1 auto;
  min-width: 0;
}

.submission-date-trigger-chevron {
  flex-shrink: 0;
  color: var(--rf4-text-muted);
  font-size: 0.75rem;
}

.submission-date-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: min(100%, 280px);
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  box-shadow: 0 12px 32px #010409cc;
}

.submission-date-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.submission-date-month {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--rf4-text);
}

.submission-date-nav {
  width: 28px;
  height: 28px;
  border: 1px solid var(--rf4-border);
  border-radius: 6px;
  background: var(--rf4-bg);
  color: var(--rf4-text-soft);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submission-date-nav:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.submission-date-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  color: var(--rf4-text-muted);
  text-align: center;
}

.submission-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 0.5rem;
}

.submission-date-cell {
  aspect-ratio: 1;
  min-height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--rf4-text-soft);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submission-date-cell.is-empty {
  pointer-events: none;
}

.submission-date-cell:hover:not(.is-empty) {
  background: var(--rf4-bg-muted);
}

.submission-date-cell.is-today {
  border: 1px solid var(--rf4-accent)55;
}

.submission-date-cell.is-selected {
  background: #238636;
  color: #fff;
  font-weight: 600;
}

.submission-date-popup-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: space-between;
}

.submission-date-popup-actions .btn-secondary {
  flex: 1 1 0;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
}

.submission-textarea {
  resize: vertical;
  min-height: 88px;
}

.submission-photos-block {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rf4-border);
  min-width: 0;
}

.submission-photos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.submission-photos-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rf4-text);
}

.submission-photos-count {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
}

.submission-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.submission-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
}

.submission-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.submission-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: var(--rf4-bg-muted)f0;
  color: #f85149;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submission-photos-add {
  display: block;
  cursor: pointer;
}

.submission-photos-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 72px;
  text-align: center;
  padding: 0.7rem 0.75rem;
  border: 1.5px dashed var(--rf4-border);
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--rf4-text-soft);
  background: var(--rf4-bg-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.submission-photos-add:hover .submission-photos-add-btn {
  border-color: #2ea043;
  color: #1a7f37;
  background: rgba(46, 160, 67, 0.1);
}

html[data-theme="dark"] .submission-photos-add:hover .submission-photos-add-btn {
  border-color: #3fb950;
  color: var(--rf4-text-soft);
  background: rgba(46, 160, 67, 0.08);
}

.submission-photos-paste-hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
  line-height: 1.35;
}

.submission-photos-paste-hint kbd {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  font-size: 0.72rem;
  font-family: inherit;
  color: var(--rf4-text-soft);
  background: var(--rf4-bg-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 4px;
}

.submission-form-actions,
.submission-notify-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.submission-form-actions .btn-secondary {
  margin-right: auto;
}

.submission-form-actions .btn-primary {
  margin-left: auto;
  min-width: 12.5rem;
  box-shadow: 0 2px 10px rgba(35, 134, 54, 0.35);
}

.submission-notify-actions {
  justify-content: flex-end;
}

@media (max-width: 820px) {
  .submission-form-row {
    flex-direction: column;
    overflow-y: auto;
  }
  .submission-form-info {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
  }
  .submission-map-slot {
    max-width: none;
    flex: 0 0 auto;
    min-height: 260px;
    height: 280px;
    justify-content: center;
  }
}

.submission-notify-meta {
  font-size: 0.84rem;
  color: var(--rf4-text-muted);
}

.submission-notify-success {
  color: #3fb950;
}

.submission-notify-reject {
  color: #ffa657;
}

.submission-notify-note,
.submission-notify-text {
  font-size: 0.88rem;
  line-height: 1.45;
}

.account-submissions-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.account-submissions-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.account-submissions-title {
  margin: 0;
  font-size: 0.95rem;
}

#adminSubmissionsList {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-submission-card.is-pending {
  border-left-color: var(--rf4-accent);
}

.admin-submission-card.is-revision {
  border-left-color: #d29922;
}

.admin-submission-card.is-rejected {
  border-left-color: #da3633;
}

.admin-submission-card.is-approved {
  border-left-color: #238636;
}

.admin-submission-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--rf4-accent);
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 0.35rem;
}

.admin-submission-card.is-revision .admin-submission-status-pill {
  background: #9e6a03;
}

.admin-submission-user {
  font-size: 0.82rem;
  color: var(--rf4-accent);
  margin: 0.15rem 0 0.2rem;
  font-weight: 500;
}

.admin-submission-meta {
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.25rem;
}

.admin-submission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rf4-border);
}

.admin-submission-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.admin-submission-photo-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
}

.admin-submission-card-clickable {
  cursor: pointer;
}

.admin-submission-card-clickable:hover {
  border-color: var(--rf4-accent);
}

.admin-submission-card-clickable:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.admin-submission-card-clickable .admin-submission-actions {
  cursor: default;
}

.admin-modlog-tab-badge[hidden],
.account-submissions-badge[hidden] {
  display: none !important;
}

.account-submissions-badge,
.admin-modlog-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f85149;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.account-submissions-desc {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

.account-submissions-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.account-submission-item {
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--rf4-bg-elevated);
}

.account-submission-item.is-approved { border-color: #238636; }
.account-submission-item.is-rejected { border-color: #da3633; }
.account-submission-item.is-revision { border-color: #d29922; }
.account-submission-item.is-pending { border-color: var(--rf4-accent)66; }

.account-submission-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.account-submission-item-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.account-submission-status {
  font-size: 0.72rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.account-submission-item-meta {
  font-size: 0.76rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.25rem;
}

.account-submission-item-text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--rf4-text-soft);
}

.account-submission-item-actions {
  margin-top: 0.45rem;
}

.account-submissions-empty {
  font-size: 0.84rem;
  color: var(--rf4-text-muted);
}

.account-submissions-more {
  margin-top: 0.5rem;
}

.admin-submission-item.is-pending {
  border-color: var(--rf4-accent)66;
}

.submission-admin-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.submission-admin-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--rf4-border);
  cursor: pointer;
}

/* --- Achievements --- */
.account-achievements-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.account-achievements-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.account-achievements-title,
.account-share-title {
  margin: 0;
  font-size: 0.95rem;
}

.account-achievements-counter {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
  font-weight: 600;
}

.account-achievements-desc,
.account-share-desc {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

.account-achievements-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.account-achievements-filter {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.account-achievements-filter.is-active {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
  background: rgba(56, 139, 253, 0.12);
}

.account-achievements-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.account-achievement-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  text-align: left;
  min-height: 0;
}

.account-achievement-card.is-locked {
  opacity: 0.55;
  filter: grayscale(0.85);
}

.account-achievement-card.is-locked::after {
  content: "🔒";
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  font-size: 0.68rem;
  opacity: 0.85;
}

.account-achievement-icon-wrap {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.account-achievement-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.account-achievement-fallback {
  font-size: 1rem;
  line-height: 1;
}

.account-achievement-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding-right: 1.1rem;
}

.account-achievement-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--rf4-text);
}

.account-achievement-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--rf4-text-muted);
}

.account-achievements-empty {
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  text-align: center;
  margin: 0.5rem 0 0;
}

.account-share-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.account-share-btn {
  width: 100%;
}

.share-app-modal-content {
  max-width: 440px;
}

.share-app-link {
  margin: 0 0 1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-accent);
  font-size: 0.88rem;
  word-break: break-all;
  text-align: center;
}

.share-app-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.achievement-unlock-content {
  max-width: 380px;
}

.achievement-unlock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin: 0.5rem 0 1rem;
  text-align: center;
}

.achievement-unlock-icon-wrap {
  width: 4rem;
  height: 4rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #1f6feb22, var(--rf4-accent)11);
  border: 1px solid rgba(88, 166, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.achievement-unlock-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.achievement-unlock-fallback {
  font-size: 1.75rem;
  line-height: 1;
}

.achievement-unlock-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.achievement-unlock-desc {
  font-size: 0.84rem;
  color: var(--rf4-text-muted);
  line-height: 1.4;
}

.modal.achievement-preview-modal {
  z-index: 3200;
}

.achievement-preview-content {
  position: relative;
  width: min(420px, 94vw);
  text-align: center;
  padding: 1.5rem 1.35rem 1.25rem;
}

.achievement-preview-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: var(--rf4-loading-scrim);
  color: var(--rf4-text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.achievement-preview-close:hover {
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
}

.achievement-preview-icon-wrap {
  width: min(18rem, 78vw);
  height: min(18rem, 78vw);
  margin: 0.15rem auto 1rem;
  border-radius: 20px;
  background: linear-gradient(145deg, #1f6feb22, var(--rf4-accent)11);
  border: 1px solid rgba(88, 166, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 28px var(--rf4-shadow);
}

.achievement-preview-content.is-unlocked .achievement-preview-icon-wrap {
  border-color: rgba(88, 166, 255, 0.55);
}

.achievement-preview-content.is-locked .achievement-preview-icon-wrap {
  filter: grayscale(0.88);
  opacity: 0.72;
}

.achievement-preview-icon {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.achievement-preview-fallback {
  font-size: 4.5rem;
  line-height: 1;
}

.achievement-preview-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rf4-text);
  margin-bottom: 0.35rem;
}

.achievement-preview-desc {
  font-size: 0.86rem;
  color: var(--rf4-text-muted);
  line-height: 1.45;
  margin-bottom: 0.55rem;
}

.achievement-preview-status {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--rf4-accent);
}

.achievement-preview-content.is-locked .achievement-preview-status {
  color: var(--rf4-text-muted);
}

.account-achievement-icon-btn {
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-achievement-icon-btn:hover {
  transform: scale(1.04);
  border-color: rgba(88, 166, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 139, 253, 0.15);
}

.account-achievement-icon-btn:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

/* --- User profile modal --- */
.modal.user-profile-modal {
  z-index: 2500;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.user-profile-content {
  width: 80vw;
  height: 80vh;
  max-width: 80vw;
  max-height: 80vh;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.user-profile-content > #accountLoggedInBlock {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.user-profile-hero,
.user-profile-tabs {
  flex-shrink: 0;
}

.user-profile-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: var(--rf4-loading-scrim);
  color: var(--rf4-text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.user-profile-close:hover {
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
}

.user-profile-hero {
  padding: 1.1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  background: linear-gradient(180deg, rgba(31, 111, 235, 0.08), transparent 70%);
}

.user-profile-head.account-profile-head {
  margin-bottom: 0.65rem;
  padding-bottom: 0;
  border-bottom: none;
  align-items: flex-start;
}

.user-profile-hero-text {
  flex: 1;
  min-width: 0;
}

.user-profile-hero-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.user-profile-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.25;
}

.user-profile-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.user-profile-role-badge.is-admin {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.45);
  color: #ff7b72;
}

.user-profile-role-badge.is-moderator {
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.4);
  color: var(--rf4-accent);
}

.user-profile-nick-row {
  margin-top: 0.15rem;
}

.user-profile-lvl-row {
  margin-top: 0.45rem;
}

.user-profile-lvl-row[hidden] {
  display: none !important;
}

.user-profile-xp-total {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
  font-weight: 600;
}

.user-profile-tabs {
  display: flex;
  gap: 0;
  padding: 0 0.65rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
  overflow-x: auto;
  scrollbar-width: none;
}

.user-profile-tabs::-webkit-scrollbar {
  display: none;
}

.user-profile-tab {
  flex: 1 0 auto;
  min-width: 0;
  padding: 0.65rem 0.55rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.user-profile-tab:hover {
  color: var(--rf4-text-soft);
}

.user-profile-tab.is-active {
  color: var(--rf4-text);
  border-bottom-color: var(--rf4-accent);
}

.user-profile-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.25rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: rgba(56, 139, 253, 0.2);
  border: 1px solid rgba(56, 139, 253, 0.45);
  color: var(--rf4-accent);
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
}

.user-profile-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem 1rem 1rem;
}

.user-profile-panel {
  display: none;
  min-height: 0;
}

.user-profile-panel.is-active {
  display: block;
}

.user-profile-panel[data-profile-panel="achievements"].is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.user-profile-body.is-achievements-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-profile-body.is-submissions-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.user-profile-panel[data-profile-panel="submissions"].is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.user-profile-panel[data-profile-panel="submissions"] .account-submissions-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.user-profile-panel[data-profile-panel="submissions"] .account-submissions-head,
.user-profile-panel[data-profile-panel="submissions"] .account-submissions-desc,
.user-profile-panel[data-profile-panel="submissions"] .user-profile-verify-hint,
.user-profile-panel[data-profile-panel="submissions"] .account-submissions-empty,
.user-profile-panel[data-profile-panel="submissions"] .account-submissions-more {
  flex-shrink: 0;
}

.user-profile-panel[data-profile-panel="submissions"] .account-submissions-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
}

.user-profile-panel[data-profile-panel="achievements"] .account-achievements-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.user-profile-panel[data-profile-panel="achievements"] .account-achievements-head,
.user-profile-panel[data-profile-panel="achievements"] .account-achievements-desc,
.user-profile-panel[data-profile-panel="achievements"] .account-achievements-empty {
  flex-shrink: 0;
}

.user-profile-panel[data-profile-panel="achievements"] .account-achievements-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-content: start;
}

.user-profile-panel .account-achievement-card {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 0.9rem 0.65rem 0.8rem;
  gap: 0.55rem;
  min-height: 8.5rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.user-profile-panel .account-achievement-card.is-unlocked {
  border-color: rgba(56, 139, 253, 0.42);
  background: linear-gradient(165deg, rgba(31, 111, 235, 0.11), var(--rf4-bg-elevated) 55%);
  box-shadow: 0 0 0 1px rgba(56, 139, 253, 0.08);
}

.user-profile-panel .account-achievement-card.is-locked {
  opacity: 1;
  filter: grayscale(0.72);
  background: var(--rf4-bg);
  border-color: var(--rf4-border);
  border-style: dashed;
  box-shadow: none;
}

.user-profile-panel .account-achievement-card.is-locked::after {
  display: none;
}

.user-profile-panel .account-achievement-icon-wrap {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 14px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.user-profile-panel .account-achievement-card.is-unlocked .account-achievement-icon-wrap {
  border-color: rgba(88, 166, 255, 0.45);
  background: linear-gradient(145deg, var(--rf4-bg), var(--rf4-bg-elevated));
}

.user-profile-panel .account-achievement-card.is-locked .account-achievement-icon-wrap {
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-border);
  box-shadow: none;
}

.user-profile-panel .account-achievement-card.is-locked .account-achievement-icon-wrap::after {
  content: "🔒";
  position: absolute;
  right: -0.2rem;
  bottom: -0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px var(--rf4-shadow);
}

.user-profile-panel .account-achievement-card.is-locked .account-achievement-name {
  color: var(--rf4-text-soft);
}

.user-profile-panel .account-achievement-card.is-locked .account-achievement-hint {
  color: var(--rf4-text-muted);
}

.user-profile-panel .account-achievement-body {
  align-items: center;
  width: 100%;
  padding-right: 0;
  gap: 0.2rem;
}

.user-profile-panel .account-achievement-name {
  font-size: 0.84rem;
  line-height: 1.2;
}

.user-profile-panel .account-achievement-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-profile-panel .account-achievement-fallback {
  font-size: 1.65rem;
}

.user-profile-panel .account-submissions-badge {
  background: rgba(56, 139, 253, 0.2);
  border: 1px solid rgba(56, 139, 253, 0.45);
  color: var(--rf4-accent);
}

.user-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.user-profile-stat {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  text-align: center;
}

.user-profile-stat-val {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.2;
}

.user-profile-stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--rf4-text-muted);
  line-height: 1.25;
}

.user-profile-stat--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-profile-stat--clickable:hover {
  border-color: rgba(56, 139, 253, 0.45);
  background: rgba(56, 139, 253, 0.08);
}

.user-profile-stat--clickable:focus-visible {
  outline: 2px solid var(--rf4-accent);
  outline-offset: 2px;
}

.user-profile-panel .account-xp-history {
  margin-bottom: 1rem;
}

.user-profile-panel .account-share-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.user-profile-panel .account-achievements-block,
.user-profile-panel .account-submissions-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.user-profile-verify-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.35);
  color: #e3b341;
  font-size: 0.82rem;
  line-height: 1.4;
}

.user-profile-verify-link {
  display: inline;
  margin-left: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--rf4-accent);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.user-profile-email-verify {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.user-profile-email-verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-profile-email-verify-actions .btn-secondary,
.user-profile-email-verify-actions .account-submit-btn {
  flex: 1 1 auto;
  width: auto;
  min-width: 9rem;
}

.account-logged-shortcut {
  margin-top: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  text-align: center;
}

.account-logged-shortcut-text {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--rf4-text-muted);
}

.account-open-profile-btn {
  width: 100%;
}

@media (max-width: 720px) {
  .user-profile-content {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    border-radius: 12px;
  }

  .user-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-profile-panel[data-profile-panel="achievements"] .account-achievements-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .user-profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .user-profile-tab {
    font-size: 0.74rem;
    padding: 0.6rem 0.4rem;
  }
}

/* --- Своё ПКМ (вместо браузерного) --- */
.rf4-ctx-menu {
  position: fixed;
  z-index: 100000;
  min-width: 11rem;
  max-width: 18rem;
  padding: 0.3rem;
  margin: 0;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: var(--rf4-text);
}

.rf4-ctx-menu[hidden] {
  display: none !important;
}

.rf4-ctx-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.rf4-ctx-item:hover:not(:disabled) {
  background: var(--rf4-bg-muted);
}

.rf4-ctx-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.rf4-ctx-item.is-danger {
  color: #ff7b72;
}

.rf4-ctx-item.is-danger:hover:not(:disabled) {
  background: rgba(248, 81, 73, 0.12);
}

.rf4-ctx-sep {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: var(--rf4-border);
}

/* --- Сканирование экрана (тест, Tesseract OCR) --- */
/* Универсальные тёмные скроллбары */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--rf4-border) var(--rf4-bg-muted);
}

*:not(.cards-scroll) {
  scrollbar-width: thin;
  scrollbar-color: var(--rf4-border) var(--rf4-bg-muted);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.cards-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, transparent 0, transparent 5px, var(--rf4-bg-muted) 5px, var(--rf4-bg-muted) calc(100% - 5px), transparent calc(100% - 5px));
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: var(--rf4-border);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--rf4-border);
}

*::-webkit-scrollbar-corner {
  background: var(--rf4-bg-muted);
  border-radius: 4px;
}

/* --------------------------------------------
   Дневник Рыбака
   -------------------------------------------- */
.tab-content-diary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.diary-header {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-shrink: 0;
}

.diary-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 1rem;
}

.diary-header-sub {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
}

.diary-mode-tabs {
  display: inline-flex;
  gap: 0.35rem;
}

.diary-mode-tabs[hidden] {
  display: none !important;
}

.diary-mode-tab {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.diary-mode-tab:hover {
  border-color: var(--rf4-border);
  color: var(--rf4-text);
}

.diary-mode-tab.is-active {
  border-color: var(--rf4-accent);
  background: rgba(56, 139, 253, 0.12);
  color: var(--rf4-accent);
}

.diary-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.diary-view {
  display: none;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.diary-view.is-active,
.diary-view:not([hidden]) {
  display: flex;
}

.diary-view[hidden] {
  display: none !important;
}

.diary-spots-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  flex-shrink: 0;
}

.diary-select--loc {
  width: auto;
  min-width: 220px;
  max-width: 320px;
}

.diary-map-hint {
  flex: 1;
  min-width: 140px;
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
}

.diary-spots-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.diary-map-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-items: flex-start;
  align-self: stretch;
}

.diary-map-wrap {
  position: relative;
  /* строго квадрат, как на главной — одинаковый min() для width и height */
  flex: 0 0 auto;
  flex-shrink: 0;
  width: min(72vh, calc(100vw - 420px));
  height: min(72vh, calc(100vw - 420px));
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  min-width: 280px;
  min-height: 280px;
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--rf4-bg-elevated);
  align-self: flex-start;
  box-sizing: border-box;
}

@supports (height: 100dvh) {
  .diary-map-wrap {
    width: min(72dvh, calc(100vw - 420px));
    height: min(72dvh, calc(100vw - 420px));
  }
}

.diary-map-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.diary-map-zoom-btn {
  pointer-events: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  color: var(--rf4-text);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  cursor: pointer;
}

.diary-map-zoom-btn:hover:not(:disabled) {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.diary-map-zoom-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.diary-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.diary-map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  opacity: 0;
  background: var(--rf4-bg-muted);
}

.diary-map-img.is-ready {
  opacity: 1;
}

.diary-map-routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.diary-route-line {
  stroke: #3fb950;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.diary-route-line.is-active,
.diary-route-line--draft {
  stroke: #f0883e;
  stroke-width: 1.4;
}

.diary-map-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 3;
}

.diary-map-wrap.can-pan .diary-map-overlay {
  cursor: grab;
}

.diary-map-coords {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  pointer-events: none;
}

.diary-map-coords[hidden] {
  display: none !important;
}

.diary-kind-tabs {
  display: inline-flex;
  gap: 0.3rem;
}

.diary-kind-tab {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.diary-kind-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.diary-kind-tab span {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  font-size: 0.8rem;
  font-weight: 650;
}

.diary-kind-tab:hover span {
  border-color: var(--rf4-border);
  color: var(--rf4-text);
}

.diary-kind-tab input:checked + span {
  border-color: var(--rf4-accent);
  background: rgba(56, 139, 253, 0.12);
  color: var(--rf4-accent);
}

.diary-kind-badge {
  display: inline-block;
  margin-right: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(240, 136, 62, 0.18);
  color: #f0883e;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.diary-route-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #f0883e;
}

.diary-route-meta[hidden] {
  display: none !important;
}

.diary-map-draft-route {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #f0883e;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.diary-map-draft-route.is-start {
  background: #3fb950;
}

.diary-map-draft-route.is-end {
  background: var(--rf4-accent);
}

.diary-map-dot--route.is-start {
  background: #3fb950;
}

.diary-map-dot--route.is-end {
  background: var(--rf4-accent);
}

.diary-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 2;
}

.diary-map-placeholder[hidden] {
  display: none !important;
}

.diary-map-draft,
.diary-map-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid #fff;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.diary-map-draft {
  background: #f0883e;
  pointer-events: none;
}

.diary-map-draft[hidden] {
  display: none !important;
}

.diary-map-dot {
  background: #3fb950;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 4;
}

.diary-map-dot.is-active,
.diary-map-dot:hover,
.diary-map-dot.is-highlight {
  background: var(--rf4-accent);
  transform: scale(1.25);
  z-index: 5;
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.9);
}

.diary-map-overlay.diary-map-hover-focus .diary-map-dot.is-dimmed {
  opacity: 0.22;
}

.diary-route-line.is-highlight {
  stroke: var(--rf4-accent);
  stroke-width: 1.8;
}

.diary-route-line.is-dimmed {
  opacity: 0.2;
}

.diary-list-item.is-map-hover {
  border-color: var(--rf4-accent);
  background: rgba(56, 139, 253, 0.12);
}

.diary-side {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  align-self: stretch;
}

#diarySpotsView.diary-view {
  overflow: hidden;
}

.diary-spot-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--rf4-accent);
  border-radius: 10px;
  background: rgba(56, 139, 253, 0.08);
  flex-shrink: 0;
}

.diary-spot-form[hidden] {
  display: none !important;
}

.diary-spot-form-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.5rem;
  color: var(--rf4-text);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.diary-spot-coords-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
}

.diary-spot-coords-label {
  color: var(--rf4-text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.diary-coords-value {
  color: var(--rf4-accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.diary-spot-modal {
  z-index: 1700;
}

.diary-spot-modal-content {
  width: min(420px, 92vw);
  max-width: 420px;
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid var(--rf4-accent);
  background: var(--rf4-bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.diary-spot-modal-content .modal-close-btn {
  display: none;
}

.diary-spot-modal-content .diary-input,
.diary-spot-modal-content .diary-textarea {
  width: 100%;
}

.diary-spot-modal-content .diary-form-actions {
  margin-top: 0.15rem;
}

.diary-route-bar {
  position: absolute;
  left: 8px;
  right: 48px;
  bottom: 8px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  font-size: 0.8rem;
}

.diary-route-bar[hidden] {
  display: none !important;
}

.diary-route-bar-btn {
  padding: 0.25rem 0.55rem !important;
  min-height: 28px;
  font-size: 0.78rem !important;
}

.diary-input,
.diary-select,
.diary-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: var(--rf4-text);
  padding: 0.48rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
}

.diary-textarea {
  resize: vertical;
  min-height: 56px;
  line-height: 1.4;
}

.diary-input:focus,
.diary-select:focus,
.diary-textarea:focus {
  outline: none;
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(56, 139, 253, 0.2);
}

.diary-form-actions,
.diary-entry-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.diary-notebooks-toolbar {
  display: flex;
  justify-content: flex-start;
  flex-shrink: 0;
}

.diary-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--rf4-text-muted);
  margin-bottom: -0.25rem;
}

.diary-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.diary-list-title {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rf4-text);
}

.diary-list-count {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  background: var(--rf4-bg-muted);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.diary-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.diary-list--wide {
  max-width: 720px;
}

.diary-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  text-align: left;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  background: var(--rf4-bg);
  color: inherit;
  cursor: pointer;
}

.diary-list-item:hover {
  border-color: var(--rf4-accent);
  background: rgba(56, 139, 253, 0.08);
}

.diary-list-item-title {
  font-weight: 650;
  color: var(--rf4-text);
  font-size: 0.88rem;
}

.diary-list-item-meta {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
}

.diary-empty {
  margin: 0.15rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.diary-empty[hidden] {
  display: none !important;
}

.diary-back-btn {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--rf4-accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0;
}

.diary-back-btn:hover { text-decoration: underline; }

.diary-detail-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  max-width: 760px;
}

.diary-detail-card--spot {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.diary-detail-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.diary-add-nb-modal-content {
  width: min(480px, 94vw);
  max-width: 480px;
}

.diary-add-nb-hint {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.diary-add-nb-meta {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-accent);
  font-size: 0.84rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.diary-add-nb-meta[hidden] {
  display: none !important;
}

.diary-add-nb-photo-status {
  margin: 0;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px dashed var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-text-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.diary-add-nb-photo-status[hidden] {
  display: none !important;
}

.diary-add-nb-photo-status.is-loading {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.diary-add-nb-photo-status.is-ready {
  border-color: rgba(35, 134, 54, 0.55);
  border-style: solid;
  color: #3fb950;
}

.diary-add-nb-photo-status.is-empty {
  border-color: var(--rf4-text-muted);
  color: var(--rf4-text-muted);
}

.diary-add-nb-preview {
  min-height: 120px;
  background: var(--rf4-bg);
  color: var(--rf4-text-soft);
  resize: vertical;
}

.diary-entry-kind-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 139, 253, 0.45);
  background: rgba(56, 139, 253, 0.12);
  color: var(--rf4-accent);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.diary-form-actions--modal {
  margin-top: 0.35rem;
  justify-content: flex-start;
}

.diary-modal-cancel-btn {
  margin-left: auto !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-text-muted) !important;
  background: var(--rf4-bg-muted) !important;
  font-weight: 700 !important;
  min-width: 5.5rem;
}

.diary-modal-cancel-btn:hover {
  border-color: var(--rf4-text-soft) !important;
  background: var(--rf4-border) !important;
  color: #fff !important;
}

.diary-notebook-detail {
  gap: 0.85rem;
  overflow: hidden;
}

.diary-nb-detail-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  flex-shrink: 0;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--rf4-bg-muted);
}

.diary-nb-detail-heading {
  flex: 1;
  min-width: 0;
}

.diary-nb-detail-heading .diary-detail-title {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.diary-nb-detail-top .diary-back-btn {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.diary-nb-detail-top .diary-danger-btn {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.diary-nb-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 0.9rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.diary-nb-compose-panel,
.diary-nb-entries-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  min-width: 0;
  padding: 1rem 1.05rem;
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(56, 139, 253, 0.06) 0%, transparent 42%),
    var(--rf4-bg-elevated);
}

.diary-nb-entries-panel {
  background:
    linear-gradient(200deg, rgba(35, 134, 54, 0.05) 0%, transparent 40%),
    var(--rf4-bg-elevated);
  overflow: hidden;
}

.diary-nb-panel-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rf4-text-muted);
}

.diary-nb-compose-panel .diary-entry-compose {
  flex: 1;
  min-height: 0;
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.diary-textarea--compose {
  flex: 1;
  min-height: 160px;
  resize: vertical;
}

.diary-nb-entries-panel .diary-entries {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
}

.diary-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.diary-detail-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--rf4-text);
}

.diary-detail-meta {
  margin: 0.2rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
}

.diary-detail-note {
  margin: 0;
  color: var(--rf4-text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.diary-detail-note[hidden] {
  display: none !important;
}

.diary-danger-btn {
  color: #f85149 !important;
  border-color: rgba(248, 81, 73, 0.45) !important;
}

.diary-entry-compose {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg);
}

.diary-photos-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.diary-photos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diary-photos-title,
.diary-photos-count {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.diary-photos-title { font-weight: 650; }

.diary-photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.diary-photo-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  cursor: zoom-in;
  background: var(--rf4-bg);
}

.diary-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}

.diary-photo-thumb:hover img {
  transform: scale(1.05);
}

.diary-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
  z-index: 2;
}

.diary-photos-add {
  display: inline-flex;
  width: fit-content;
  cursor: pointer;
}

.diary-photos-add[hidden] {
  display: none !important;
}

.diary-photos-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border: 1px dashed var(--rf4-border);
  border-radius: 8px;
  color: var(--rf4-text-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

.diary-photos-add:hover .diary-photos-add-btn {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.diary-entries {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.diary-entry-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  background: var(--rf4-bg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease;
}

.diary-entry-card:hover {
  border-color: var(--rf4-border);
}

.diary-entry-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.diary-entry-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rf4-text);
}

.diary-entry-card-time {
  font-size: 0.74rem;
  color: var(--rf4-text-muted);
  white-space: nowrap;
}

.diary-entry-card-text {
  margin: 0;
  color: var(--rf4-text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}

.diary-entry-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.diary-entry-photos img,
.diary-entry-photo-btn img {
  width: 140px;
  height: 140px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--rf4-border);
  display: block;
}

.diary-entry-photo-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.diary-entry-photo-btn:hover img {
  border-color: var(--rf4-accent);
  box-shadow: 0 0 0 2px rgba(56, 139, 253, 0.25);
}

.lightbox-copy {
  position: absolute;
  top: 0.75rem;
  right: 4rem;
  z-index: 2005;
  min-height: 40px;
  padding: 0 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--rf4-text);
  background: var(--rf4-loading-scrim);
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  cursor: pointer;
}

.lightbox-copy:hover {
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
  background: var(--rf4-loading-scrim);
}

@media (max-width: 960px) {
  .diary-spots-layout {
    grid-template-columns: 1fr;
  }

  .diary-nb-detail-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .diary-nb-compose-panel,
  .diary-nb-entries-panel {
    overflow: visible;
  }

  .diary-nb-entries-panel .diary-entries {
    overflow: visible;
  }

  .diary-map-wrap {
    width: min(88vw, 72vh);
    height: min(88vw, 72vh);
    min-width: 240px;
    min-height: 240px;
  }

  .diary-side {
    max-height: 240px;
    height: auto;
  }
}

/* ============================================
   LIGHT THEME — основные поверхности интерфейса
   ============================================ */
html[data-theme="light"] body {
  background: var(--rf4-bg);
  color: var(--rf4-text);
}

html[data-theme="light"] .header,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .settings-layout,
html[data-theme="light"] .settings-nav,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .toast-notify-inner,
html[data-theme="light"] .card,
html[data-theme="light"] .point-card,
html[data-theme="light"] .detail-map-panel,
html[data-theme="light"] .points-panel,
html[data-theme="light"] .tab-content-inner,
html[data-theme="light"] .music-player-panel,
html[data-theme="light"] .chat-panel,
html[data-theme="light"] .chat-drawer,
html[data-theme="light"] .distance-ruler-modal .modal-content,
html[data-theme="light"] .whats-new-content,
html[data-theme="light"] .auth-gate-card {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text);
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .header {
  background: var(--rf4-bg-elevated) !important;
  border-bottom-color: var(--rf4-border) !important;
}

html[data-theme="light"] .sidebar {
  background: var(--rf4-bg-elevated) !important;
  border-right-color: var(--rf4-border) !important;
}

html[data-theme="light"] .nav-item {
  color: var(--rf4-text-muted);
}

html[data-theme="light"] .nav-item:hover {
  color: var(--rf4-text);
  background: var(--rf4-bg-muted);
}

html[data-theme="light"] .nav-item.active {
  color: var(--rf4-accent);
  background: var(--rf4-accent-soft);
}

html[data-theme="light"] .nav-item-share {
  color: var(--rf4-share);
  background: var(--rf4-share-soft);
  border-color: var(--rf4-share-border);
}

html[data-theme="light"] .nav-item-share .nav-label {
  color: var(--rf4-share);
}

html[data-theme="light"] .nav-item-share:hover {
  color: var(--rf4-share);
  background: rgba(196, 92, 0, 0.18);
  border-color: var(--rf4-share);
}

html[data-theme="light"] .nav-item-share:hover .nav-label {
  color: var(--rf4-share);
}

html[data-theme="light"] .nav-item-bazaar {
  color: #9a6700;
  background: rgba(154, 103, 0, 0.08);
  border: 1px solid rgba(154, 103, 0, 0.28);
}

html[data-theme="light"] .nav-item-bazaar .nav-label {
  color: #9a6700;
  font-weight: 600;
}

html[data-theme="light"] .nav-item-bazaar:hover {
  color: #7d5200;
  background: rgba(154, 103, 0, 0.14);
  border-color: rgba(154, 103, 0, 0.45);
}

html[data-theme="light"] .nav-item-bazaar.active {
  color: #7d5200;
  background: rgba(154, 103, 0, 0.14);
  border-color: rgba(154, 103, 0, 0.45);
}

html[data-theme="light"] .nav-item-bazaar:hover .nav-label,
html[data-theme="light"] .nav-item-bazaar.active .nav-label {
  color: #7d5200;
}

html[data-theme="light"] .nav-item-bazaar.has-bazaar-clients {
  background: rgba(207, 34, 46, 0.1);
  border-color: rgba(207, 34, 46, 0.45);
}

html[data-theme="light"] .nav-item-bazaar.has-bazaar-clients .nav-label {
  color: #cf222e;
}

html[data-theme="light"] .header-stat-chip,
html[data-theme="light"] .header-whats-new-btn,
html[data-theme="light"] .header-budilnik-btn,
html[data-theme="light"] .header-music-btn,
html[data-theme="light"] .header-update-btn,
html[data-theme="light"] .settings-nav-item,
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] textarea,
html[data-theme="light"] .filter-bar,
html[data-theme="light"] .points-list,
html[data-theme="light"] .today-feed-item,
html[data-theme="light"] .admin-modlog-hidden-desc,
html[data-theme="light"] .settings-row,
html[data-theme="light"] .tumbler-track {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .settings-nav-item.is-active,
html[data-theme="light"] .settings-nav-item[aria-current="page"] {
  background: var(--rf4-accent-soft) !important;
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .settings-panel-title,
html[data-theme="light"] .tab-page-title,
html[data-theme="light"] .points-title,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5 {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .settings-panel-desc,
html[data-theme="light"] .header-stat-label,
html[data-theme="light"] .map-placeholder,
html[data-theme="light"] .point-card-date,
html[data-theme="light"] .coords,
html[data-theme="light"] .whats-new-intro,
html[data-theme="light"] .load-text {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .settings-label {
  color: var(--rf4-text) !important;
  font-weight: 500;
}

html[data-theme="light"] .btn-primary {
  background: var(--rf4-accent) !important;
  border-color: var(--rf4-accent) !important;
  color: #fff !important;
}

html[data-theme="light"] .modal {
  background: rgba(31, 35, 40, 0.45);
}

html[data-theme="light"] .modal-content {
  box-shadow: 0 12px 40px var(--rf4-shadow);
}

html[data-theme="light"] .card,
html[data-theme="light"] .point-card,
html[data-theme="light"] .guide-card,
html[data-theme="light"] .today-feed-item {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 1px 2px var(--rf4-shadow);
}

html[data-theme="light"] .card:hover,
html[data-theme="light"] .point-card:hover,
html[data-theme="light"] .card.active {
  border-color: var(--rf4-accent) !important;
  background: var(--rf4-bg-elevated) !important;
}

html[data-theme="light"] .detail-map-wrap,
html[data-theme="light"] .map-placeholder,
html[data-theme="light"] .detail-map-container {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .game-status-bar.disconnected {
  background: #fff8f6 !important;
  color: #cf222e !important;
  border-color: #ffcecb !important;
}

html[data-theme="light"] .game-status-bar.connected {
  background: #dafbe1 !important;
  color: #1a7f37 !important;
  border-color: #4ac26b !important;
}

html[data-theme="light"] .load-overlay {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .load-overlay-panel {
  background: #ffffff !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 10px 32px rgba(31, 35, 40, 0.12);
}

html[data-theme="light"] .load-overlay-logo {
  opacity: 0.28;
}

html[data-theme="light"] .load-text,
html[data-theme="light"] .load-progress-intro,
html[data-theme="light"] .load-boot-error-title {
  color: #1f2328 !important;
}

html[data-theme="light"] .load-progress-meta,
html[data-theme="light"] .load-progress-tip,
html[data-theme="light"] .load-version,
html[data-theme="light"] .load-boot-error-text {
  color: #424a53 !important;
}

html[data-theme="light"] .load-spinner {
  border-color: #d0d7de;
  border-top-color: #0969da;
}

html[data-theme="light"] .load-progress-track {
  background: #eaeef2;
}

html[data-theme="light"] .whats-new-list li,
html[data-theme="light"] .fish-name,
html[data-theme="light"] .nav-label {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .main-content,
html[data-theme="light"] .app-body,
html[data-theme="light"] .content-wrap,
html[data-theme="light"] .tab-panel {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text);
}

html[data-theme="light"] .settings-layout {
  background: var(--rf4-bg) !important;
}

html[data-theme="light"] .settings-nav {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .header-brand {
  background: var(--rf4-bg) !important;
  border-color: var(--rf4-border) !important;
}

/* ========== Состязания ========== */
.tab-content-contests {
  height: 100%;
  min-height: 0;
}

.contests-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  min-height: 0;
  padding: 0.25rem 0.15rem 1rem;
}

.contests-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.contests-head-sub {
  margin: 0.35rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
}

.contests-create-btn {
  flex-shrink: 0;
}

.contests-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.contests-filter {
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.contests-filter:hover {
  border-color: var(--rf4-border);
}

.contests-filter.is-active {
  background: var(--rf4-bg-muted);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.contests-error,
.contests-form-error {
  color: #ffa198;
  font-size: 0.9rem;
  margin: 0;
}

.contests-empty {
  color: var(--rf4-text-muted);
  margin: 1rem 0 0;
}

.contests-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: auto;
  min-height: 0;
  padding-bottom: 0.5rem;
}

.contests-card {
  border: 1px solid var(--rf4-border);
  background: linear-gradient(180deg, var(--rf4-bg-elevated) 0%, var(--rf4-bg) 100%);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.contests-card:hover {
  border-color: var(--rf4-accent);
  transform: translateY(-1px);
}

.contests-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.contests-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--rf4-text);
  flex: 1 1 auto;
}

.contests-card-lock {
  font-size: 0.9rem;
}

.contests-status {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-muted);
}

.contests-status--active {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.45);
}

.contests-status--finished {
  color: var(--rf4-text-muted);
}

.contests-status--cancelled {
  color: #ffa657;
  border-color: rgba(255, 166, 87, 0.4);
}

.contests-card-meta,
.contests-card-foot,
.contests-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-top: 0.55rem;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.contests-card-foot {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.contests-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.contests-modal[hidden] {
  display: none !important;
}

.contests-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.72);
}

.contests-modal-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 96vw);
  max-height: min(92vh, 920px);
  overflow: auto;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  padding: 1.15rem 1.35rem 1.35rem;
}

.contests-modal-panel--create {
  width: min(1120px, 96vw);
}

.contests-modal-panel--detail {
  width: min(980px, 96vw);
}

.contests-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.contests-modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.contests-wizard-sub {
  margin: 0.3rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.86rem;
}

.contests-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.contests-wizard-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.contests-wizard-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.contests-wizard-step.is-active {
  border-color: var(--rf4-accent);
  color: var(--rf4-text);
  background: var(--rf4-accent-soft);
  box-shadow: 0 0 0 1px var(--rf4-accent-soft);
}

.contests-wizard-step.is-active span {
  background: var(--rf4-accent);
  color: #ffffff;
}

.contests-wizard-step.is-done {
  border-color: rgba(46, 160, 67, 0.45);
  color: #1a7f37;
  background: rgba(46, 160, 67, 0.1);
}

html[data-theme="dark"] .contests-wizard-step.is-done {
  color: #3fb950;
  background: rgba(35, 134, 54, 0.14);
}

.contests-wizard-step.is-done span {
  background: #238636;
  color: #ffffff;
}

.contests-wizard-step:disabled {
  opacity: 0.55;
  cursor: default;
}

.contests-wizard-pane[hidden] {
  display: none !important;
}

.contests-wizard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.contests-field--wide {
  grid-column: 1 / -1;
}

.contests-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.contests-wizard-actions .btn-primary {
  margin-left: auto;
}

.contests-wizard-summary {
  margin-top: 0.85rem;
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  background: var(--rf4-bg-elevated);
  padding: 0.85rem 1rem;
}

.contests-wizard-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.contests-wizard-summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.contests-wizard-summary-grid span {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.contests-wizard-summary-grid strong {
  font-size: 0.95rem;
  color: var(--rf4-text);
  word-break: break-word;
}

.contests-wizard-pwd {
  color: #ffe8a3 !important;
  letter-spacing: 0.04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 900px) {
  .contests-wizard-grid,
  .contests-wizard-summary-grid,
  .contests-victory-list,
  .contests-wizard-steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .contests-wizard-steps,
  .contests-wizard-grid,
  .contests-wizard-summary-grid,
  .contests-victory-list,
  .contests-fish-mode {
    grid-template-columns: 1fr;
  }
}

.contests-modal-close {
  border: 0;
  background: transparent;
  color: var(--rf4-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.contests-modal-close:hover {
  color: var(--rf4-text);
}

.contests-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contests-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--rf4-text-soft);
}

.contests-field input,
.contests-field textarea,
.contests-field select,
.contests-detail-locked input {
  width: 100%;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.contests-field textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.contests-fieldset {
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem 0.8rem;
  margin: 0;
}

.contests-fieldset legend {
  padding: 0 0.35rem;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
}

.contests-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contests-chip,
.contests-victory,
.contests-fish-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--rf4-text-soft);
  font-size: 0.88rem;
}

.contests-victory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
}

.contests-fish-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: var(--rf4-bg-elevated);
}

.contests-fish-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.contests-fish-mode-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  min-height: 2.65rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  font-size: 0.95rem;
  font-weight: 560;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.contests-fish-mode-opt:hover {
  border-color: var(--rf4-border);
}

.contests-fish-mode-opt:has(input:checked),
.contests-fish-mode-opt.is-active {
  border-color: var(--rf4-accent);
  background: #13233a;
  color: var(--rf4-accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.25);
}

.contests-fish-mode-opt input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--rf4-accent);
}

.contests-fish-grid {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--rf4-border);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--rf4-bg-elevated);
}

.contests-fish-cells {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.55rem;
}

.contests-fish-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  border-radius: 10px;
  padding: 0.45rem 0.35rem 0.55rem;
  cursor: pointer;
  color: var(--rf4-text-soft);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.contests-fish-cell:hover {
  border-color: var(--rf4-accent);
  transform: translateY(-1px);
}

.contests-fish-cell.is-selected {
  border-color: #3fb950;
  background: #122117;
  box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.35);
}

.contests-fish-cell--view {
  cursor: pointer;
}

.contests-fish-cell-media {
  width: 64px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contests-fish-cell-img {
  max-width: 64px;
  max-height: 48px;
  object-fit: contain;
}

.contests-fish-cell-fallback {
  font-size: 1.4rem;
  opacity: 0.7;
}

.contests-fish-cell-name {
  font-size: 0.72rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.contests-any-fish-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(88, 166, 255, 0.45);
  background: #13233a;
  color: var(--rf4-accent);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
}

.contests-password-hero {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(210, 153, 34, 0.55);
  background:
    linear-gradient(135deg, rgba(210, 153, 34, 0.18), rgba(13, 17, 23, 0.2) 55%),
    var(--rf4-bg-elevated);
  box-shadow: 0 0 0 1px rgba(210, 153, 34, 0.12), 0 10px 28px rgba(0, 0, 0, 0.28);
}

.contests-password-hero-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e3b341;
  font-weight: 650;
}

.contests-password-hero-value {
  margin-top: 0.45rem;
  font-size: clamp(1.55rem, 3.2vw, 2.05rem);
  font-weight: 760;
  letter-spacing: 0.08em;
  color: #ffe8a3;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.contests-password-hero-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.contests-password-hero-hint {
  color: var(--rf4-text-soft);
  font-size: 0.82rem;
  opacity: 0.9;
}

.contests-fish-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.contests-fish-hint {
  color: var(--rf4-text-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.contests-fish-placeholder {
  margin: 0;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.contests-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.35rem;
}

.contests-detail-block {
  margin-top: 1rem;
}

.contests-detail-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--rf4-text-soft);
}

.contests-detail-block p,
.contests-conditions-text {
  margin: 0;
  color: var(--rf4-text);
  line-height: 1.45;
  white-space: pre-wrap;
}

.contests-conditions-text {
  white-space: normal;
}

.contests-fish-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contests-fish-chip {
  border: 1px solid var(--rf4-accent)66;
  background: #13233a;
  color: var(--rf4-accent);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.contests-fish-chip:hover {
  border-color: var(--rf4-accent);
  background: #1b2f4a;
}

.contests-loc-link {
  border: 0;
  background: transparent;
  color: var(--rf4-accent);
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contests-detail-locked {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contests-detail-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rf4-bg-muted);
}

.contests-danger {
  color: #ffa198 !important;
  border-color: rgba(248, 81, 73, 0.45) !important;
}

.contests-insight {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contests-insight-fish {
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
  background: var(--rf4-bg-elevated);
  padding: 0.75rem 0.85rem;
}

.contests-insight-fish-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.55rem;
}

.contests-insight-fish-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.contests-insight-fish-title strong {
  font-size: 0.98rem;
  color: var(--rf4-text);
}

.contests-insight-fish-media {
  width: 42px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contests-insight-fish-img {
  max-width: 42px;
  max-height: 34px;
  object-fit: contain;
}

.contests-insight-count {
  font-size: 0.75rem;
  color: var(--rf4-text-muted);
  border: 1px solid var(--rf4-border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.contests-insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.contests-insight-btn {
  padding: 0.3rem 0.65rem !important;
  font-size: 0.8rem !important;
  min-height: 0 !important;
}

.contests-insight-posts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contests-insight-post {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--rf4-bg-muted);
  background: var(--rf4-bg);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease;
}

.contests-insight-post:hover {
  border-color: var(--rf4-accent);
}

.contests-insight-post-meta {
  font-size: 0.78rem;
  color: var(--rf4-text-muted);
}

.contests-insight-post-text {
  font-size: 0.86rem;
  color: var(--rf4-text-soft);
  line-height: 1.35;
}

html[data-theme="light"] .contests-insight-fish,
html[data-theme="light"] .contests-insight-post {
  background: var(--rf4-bg-elevated, #fff);
  border-color: var(--rf4-border, #d0d7de);
}

html[data-theme="light"] .contests-insight-fish-title strong,
html[data-theme="light"] .contests-insight-post-text {
  color: var(--rf4-text, #1f2328);
}

html[data-theme="light"] .contests-card,
html[data-theme="light"] .contests-modal-panel,
html[data-theme="light"] .contests-fish-picker,
html[data-theme="light"] .contests-fish-grid,
html[data-theme="light"] .contests-fish-cell,
html[data-theme="light"] .contests-field input,
html[data-theme="light"] .contests-field textarea,
html[data-theme="light"] .contests-field select,
html[data-theme="light"] .contests-detail-locked input {
  background: var(--rf4-bg-elevated, #fff);
  border-color: var(--rf4-border, #d0d7de);
  color: var(--rf4-text, #1f2328);
}

html[data-theme="light"] .contests-password-hero {
  background: linear-gradient(135deg, #fff7e0, #fff);
  border-color: #d4a72c;
}

html[data-theme="light"] .contests-password-hero-value {
  color: #8a6d00;
}

html[data-theme="light"] .contests-card-title,
html[data-theme="light"] .contests-detail-block p,
html[data-theme="light"] .contests-conditions-text {
  color: var(--rf4-text, #1f2328);
}

html[data-theme="light"] .contests-filter {
  background: var(--rf4-bg, #f6f8fa);
  color: var(--rf4-text, #1f2328);
}

/* ============================================
   LIGHT THEME — таблицы, текст, иконки
   ============================================ */

/* --- Таблицы: светлые поверхности --- */
html[data-theme="light"] .trophies-table-wrap,
html[data-theme="light"] .records-table-wrap,
html[data-theme="light"] .reels-table-wrap,
html[data-theme="light"] .rods-table-wrap,
html[data-theme="light"] .hooks-table-wrap,
html[data-theme="light"] .gb-table-wrap,
html[data-theme="light"] .reels-compare-table-wrap,
html[data-theme="light"] .rods-compare-table-wrap,
html[data-theme="light"] .records-modal-table-wrap,
html[data-theme="light"] .admin-catalog-table {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text);
  box-shadow: none;
}

html[data-theme="light"] .trophies-table th,
html[data-theme="light"] .records-table th,
html[data-theme="light"] .reels-table th,
html[data-theme="light"] .rods-table th,
html[data-theme="light"] .hooks-table th,
html[data-theme="light"] .gb-table th,
html[data-theme="light"] .analytics-table th,
html[data-theme="light"] .rec-th,
html[data-theme="light"] .reels-compare-param-col,
html[data-theme="light"] .reels-compare-reel-col,
html[data-theme="light"] .reels-compare-reel-header,
html[data-theme="light"] .rods-compare-param-col,
html[data-theme="light"] .rods-compare-rod-col,
html[data-theme="light"] .rods-compare-rod-header,
html[data-theme="light"] .admin-catalog-table-head {
  background: var(--rf4-bg-muted) !important;
  color: var(--rf4-text-muted) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 1px 0 0 var(--rf4-border);
}

html[data-theme="light"] .trophies-table th,
html[data-theme="light"] .trophies-table td,
html[data-theme="light"] .records-table th,
html[data-theme="light"] .records-table td,
html[data-theme="light"] .reels-table th,
html[data-theme="light"] .reels-table td,
html[data-theme="light"] .rods-table th,
html[data-theme="light"] .rods-table td,
html[data-theme="light"] .hooks-table th,
html[data-theme="light"] .hooks-table td,
html[data-theme="light"] .analytics-table th,
html[data-theme="light"] .analytics-table td,
html[data-theme="light"] .gb-table th,
html[data-theme="light"] .gb-table td,
html[data-theme="light"] .admin-catalog-table-row {
  border-bottom-color: var(--rf4-border) !important;
}

html[data-theme="light"] .hooks-table th.hooks-th-name,
html[data-theme="light"] .hooks-table td.hooks-td-name,
html[data-theme="light"] .hooks-table th.hooks-th-type,
html[data-theme="light"] .hooks-table td.hooks-td-type {
  background: var(--rf4-bg-elevated) !important;
}

html[data-theme="light"] .hooks-table th.hooks-th-name,
html[data-theme="light"] .hooks-table th.hooks-th-type {
  background: var(--rf4-bg-muted) !important;
}

/* Текст в таблицах — чёрный / тёмный */
html[data-theme="light"] .td-name,
html[data-theme="light"] .td-weight,
html[data-theme="light"] .rec-td,
html[data-theme="light"] .rec-td-weight,
html[data-theme="light"] .reels-td-name,
html[data-theme="light"] .rods-td-name,
html[data-theme="light"] .hooks-td-name,
html[data-theme="light"] .hooks-td-weight,
html[data-theme="light"] .analytics-table td,
html[data-theme="light"] .gb-table td,
html[data-theme="light"] .reels-compare-cell,
html[data-theme="light"] .reels-compare-reel-name,
html[data-theme="light"] .rods-compare-cell,
html[data-theme="light"] .rods-compare-rod-name,
html[data-theme="light"] .admin-catalog-table-row,
html[data-theme="light"] .gear-detail-cell-price-silver {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .td-rarity,
html[data-theme="light"] .rec-td-bait,
html[data-theme="light"] .trophies-empty,
html[data-theme="light"] .records-empty,
html[data-theme="light"] .reels-compare-empty,
html[data-theme="light"] .rods-compare-empty,
html[data-theme="light"] .reels-compare-param-name,
html[data-theme="light"] .rods-compare-param-name,
html[data-theme="light"] .analytics-bar-label {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .gb-table tbody tr:nth-child(even) {
  background: rgba(31, 35, 40, 0.04);
}

html[data-theme="light"] .gb-table tbody tr:hover,
html[data-theme="light"] .records-row-clickable:hover,
html[data-theme="light"] .reels-table tbody tr:hover,
html[data-theme="light"] .rods-table tbody tr:hover,
html[data-theme="light"] .records-table tbody tr:hover,
html[data-theme="light"] .trophies-table tbody tr:hover {
  background: rgba(9, 105, 218, 0.08) !important;
}

html[data-theme="light"] .reels-compare-thumb,
html[data-theme="light"] .rods-compare-thumb {
  background: var(--rf4-bg-muted) !important;
}

html[data-theme="light"] .reels-th-sortable:hover,
html[data-theme="light"] .rods-th-sortable:hover,
html[data-theme="light"] .reels-th-sortable.sorted-asc::after,
html[data-theme="light"] .reels-th-sortable.sorted-desc::after,
html[data-theme="light"] .rods-th-sortable.sorted-asc::after,
html[data-theme="light"] .rods-th-sortable.sorted-desc::after {
  color: var(--rf4-accent) !important;
}

/* Тулбары / кнопки вокруг таблиц */
html[data-theme="light"] .reels-compare-btn,
html[data-theme="light"] .rods-compare-btn,
html[data-theme="light"] .records-by-lake-btn,
html[data-theme="light"] .records-filter-date,
html[data-theme="light"] .points-filter-date,
html[data-theme="light"] .admin-catalog-icon-btn,
html[data-theme="light"] .chat-attach-btn {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .records-by-lake-btn {
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .points-filter-date::-webkit-calendar-picker-indicator,
html[data-theme="light"] .records-filter-date::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.75;
}

html[data-theme="light"] .points-filter-date::-webkit-datetime-edit,
html[data-theme="light"] .records-filter-date::-webkit-datetime-edit {
  color: var(--rf4-text) !important;
}

/* Общий читаемый текст поверх захардкоженных светлых цветов */
html[data-theme="light"] .tab-content-inner,
html[data-theme="light"] .tab-panel,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .point-card,
html[data-theme="light"] .card,
html[data-theme="light"] .guide-card,
html[data-theme="light"] .chat-panel,
html[data-theme="light"] .music-player-panel {
  color: var(--rf4-text);
}

html[data-theme="light"] p,
html[data-theme="light"] label,
html[data-theme="light"] .settings-row-title,
html[data-theme="light"] .settings-row-value,
html[data-theme="light"] .filter-label,
html[data-theme="light"] .toolbar-label,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .empty-hint,
html[data-theme="light"] .hint-text,
html[data-theme="light"] .muted,
html[data-theme="light"] .secondary-text {
  color: var(--rf4-text);
}

html[data-theme="light"] .settings-panel-desc,
html[data-theme="light"] .settings-hint,
html[data-theme="light"] .form-hint,
html[data-theme="light"] .chat-compose-hint,
html[data-theme="light"] .contests-head-sub,
html[data-theme="light"] .contests-empty,
html[data-theme="light"] .contests-card-meta,
html[data-theme="light"] .contests-card-foot,
html[data-theme="light"] .contests-detail-meta {
  color: var(--rf4-text-muted) !important;
}

/* Белые PNG-иконки → тёмные (цветные trophy/discord не трогаем; send — белая на зелёной кнопке) */
html[data-theme="light"] .nav-icon-img,
html[data-theme="light"] .settings-row-icon,
html[data-theme="light"] .main-share-btn-icon,
html[data-theme="light"] .post-modal-share-btn-icon,
html[data-theme="light"] img[src*="/assets/icons/share.png"] {
  filter: invert(1);
}

html[data-theme="light"] .nav-item-discord .nav-icon-img,
html[data-theme="light"] .nav-item[data-nav-icon="discord"] .nav-icon-img,
html[data-theme="light"] img.settings-row-icon[src*="discord"],
html[data-theme="light"] img[src*="discord.png"],
html[data-theme="light"] img[src*="trophy.png"],
html[data-theme="light"] img[src*="rare_trophy.png"],
html[data-theme="light"] img[src*="rare_species.png"],
html[data-theme="light"] .efw-trophy-icon,
html[data-theme="light"] .efm-trophy-icon,
html[data-theme="light"] .encyclopedia-rarity-icon,
html[data-theme="light"] .efm-rarity-icon {
  filter: none !important;
}

/* SVG / currentColor иконки */
html[data-theme="light"] .chat-attach-btn,
html[data-theme="light"] .chat-attach-icon,
html[data-theme="light"] .header-whats-new-btn,
html[data-theme="light"] .header-budilnik-btn,
html[data-theme="light"] .header-music-btn,
html[data-theme="light"] .header-update-btn,
html[data-theme="light"] .nav-item,
html[data-theme="light"] .admin-catalog-icon-btn {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .nav-item.active {
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .header-whats-new-badge {
  box-shadow: 0 0 0 2px var(--rf4-bg-elevated);
}

/* Кнопки/чипы с тёмным фоном */
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .filter-chip,
html[data-theme="light"] .chip,
html[data-theme="light"] .tag,
html[data-theme="light"] .pill {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .contests-modal-backdrop {
  background: rgba(31, 35, 40, 0.45);
}

html[data-theme="light"] .contests-modal-panel {
  box-shadow: 0 12px 40px var(--rf4-shadow);
}

/* Records / gear chrome around tables */
html[data-theme="light"] .records-back-btn,
html[data-theme="light"] .records-loc-nav-toggle,
html[data-theme="light"] .main-share-btn,
html[data-theme="light"] .reels-compare-btn,
html[data-theme="light"] .rods-compare-btn,
html[data-theme="light"] .post-modal-share-btn {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .records-back-btn,
html[data-theme="light"] .records-by-lake-btn {
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .main-share-btn:hover,
html[data-theme="light"] .records-back-btn:hover,
html[data-theme="light"] .reels-compare-btn:hover,
html[data-theme="light"] .rods-compare-btn:hover:not(:disabled) {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-accent) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .records-breadcrumb,
html[data-theme="light"] .records-breadcrumb span {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .encyclopedia-detail-title,
html[data-theme="light"] .encyclopedia-detail-kv dd,
html[data-theme="light"] .encyclopedia-detail-list,
html[data-theme="light"] .encyclopedia-fish-modal-content,
html[data-theme="light"] .encyclopedia-detail-section h4 {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .encyclopedia-detail-rarity,
html[data-theme="light"] .encyclopedia-detail-kv dt,
html[data-theme="light"] .encyclopedia-detail-note {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .encyclopedia-detail-tiers th,
html[data-theme="light"] .encyclopedia-detail-tiers td {
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .encyclopedia-loc-chip {
  background: var(--rf4-bg-muted) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

/* Модалки сравнения / детали снастей */
html[data-theme="light"] .reels-compare-modal .modal-content,
html[data-theme="light"] .rods-compare-modal .modal-content,
html[data-theme="light"] .rods-compare-modal-content,
html[data-theme="light"] .gear-detail-modal .modal-content {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .reels-compare-title,
html[data-theme="light"] .rods-compare-title {
  color: var(--rf4-text) !important;
}

/* Скроллбары таблиц на светлом фоне */
html[data-theme="light"] .records-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .reels-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .rods-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .hooks-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .trophies-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .reels-compare-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .rods-compare-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .records-modal-table-wrap::-webkit-scrollbar-track {
  background: var(--rf4-bg-muted);
}

html[data-theme="light"] .records-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .reels-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .rods-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .hooks-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .trophies-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .reels-compare-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .rods-compare-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .records-modal-table-wrap::-webkit-scrollbar-thumb {
  background: #afb8c1;
  border-color: var(--rf4-bg-muted);
}

/* ============================================
   LIGHT THEME — тёмные рамки: точки, фильтры, шапка
   ============================================ */

/* Панель точек справа от карты */
html[data-theme="light"] .detail-points-panel {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 1px 4px var(--rf4-shadow);
  color: var(--rf4-text);
}

html[data-theme="light"] .points-filters-bar {
  background: var(--rf4-bg-muted) !important;
  border-bottom-color: var(--rf4-border) !important;
}

html[data-theme="light"] .points-filter-label,
html[data-theme="light"] .points-panel-subtitle,
html[data-theme="light"] .points-summary-caption {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .points-list {
  background: var(--rf4-bg) !important;
  border-color: var(--rf4-border) !important;
  scrollbar-color: #afb8c1 var(--rf4-bg);
}

html[data-theme="light"] .point-card {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
  box-shadow: 0 1px 2px var(--rf4-shadow);
}

html[data-theme="light"] .point-card-text,
html[data-theme="light"] .point-card .coords,
html[data-theme="light"] .point-card .fish,
html[data-theme="light"] .point-card-date {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .point-feed-status.is-not-actual,
html[data-theme="light"] .point-feed-status.is-unknown {
  color: var(--rf4-text-muted) !important;
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .main-share-block {
  border-top-color: var(--rf4-border) !important;
}

html[data-theme="light"] .main-share-btn,
html[data-theme="light"] .main-add-point-btn {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .main-share-btn:hover,
html[data-theme="light"] .main-add-point-btn:hover {
  background: var(--rf4-bg-muted) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-accent) !important;
}

/* Дропдауны фильтров (Вся рыба / Все локации / …) */
html[data-theme="light"] .points-fish-dropdown-trigger,
html[data-theme="light"] .trophies-filter-select,
html[data-theme="light"] .trophies-filter-search,
html[data-theme="light"] .points-reset-btn {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .points-fish-dropdown-list,
html[data-theme="light"] .records-combo-list {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 8px 24px var(--rf4-shadow);
}

html[data-theme="light"] .points-fish-dropdown-option {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .points-fish-dropdown-option:hover,
html[data-theme="light"] .points-fish-dropdown-option:focus {
  background: var(--rf4-bg-muted) !important;
}

/* Фильтры энциклопедии / рекордов / снастей */
html[data-theme="light"] .trophies-filters,
html[data-theme="light"] .encyclopedia-filters,
html[data-theme="light"] .feed-filters-panel,
html[data-theme="light"] .reels-filters,
html[data-theme="light"] .rods-filters,
html[data-theme="light"] .hooks-filters,
html[data-theme="light"] .records-filters,
html[data-theme="light"] .filter-bar {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text);
}

html[data-theme="light"] .trophies-filter-label,
html[data-theme="light"] .feed-filters-title {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .feed-filter-reset {
  border-color: var(--rf4-border) !important;
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .feed-filter-reset:hover {
  background: var(--rf4-bg-muted) !important;
}

html[data-theme="light"] .feed-top-fish-btn {
  background: var(--rf4-bg) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .feed-vk-card,
html[data-theme="light"] .today-feed-item {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
  box-shadow: 0 1px 3px var(--rf4-shadow);
}

html[data-theme="light"] .feed-vk-author,
html[data-theme="light"] .today-feed-coords {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .feed-vk-meta,
html[data-theme="light"] .feed-vk-time,
html[data-theme="light"] .today-feed-loc,
html[data-theme="light"] .feed-page-sub {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .feed-vk-avatar {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .today-feed-refresh {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

/* Иконки-кнопки на карточках точек */
html[data-theme="light"] .rf4-cross-link-btn,
html[data-theme="light"] .rf4-cross-link-btn--icon {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .rf4-cross-link-btn:hover,
html[data-theme="light"] .rf4-cross-link-btn--icon:hover {
  background: var(--rf4-accent-soft) !important;
  border-color: var(--rf4-accent) !important;
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .rf4-cross-link-btn--icon .rf4-cross-link-icon-img,
html[data-theme="light"] .rf4-cross-link-btn--icon .rf4-icon-dual-img {
  filter: invert(1);
}

html[data-theme="light"] .rf4-icon-dual-fallback,
html[data-theme="light"] .rf4-cross-link-icon.rf4-icon-dual .rf4-icon-dual-fallback {
  color: var(--rf4-text) !important;
}

/* Шапка: статус игры, уведомления, профиль */
html[data-theme="light"] .game-status-bar {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .game-status-label,
html[data-theme="light"] .game-status-port,
html[data-theme="light"] .game-status-time {
  background: var(--rf4-bg) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .game-status-bar.disconnected .game-status-label {
  color: #cf222e !important;
  background: #fff8f6 !important;
  border-color: #ffcecb !important;
}

html[data-theme="light"] .game-status-bar.connected .game-status-label {
  color: #1a7f37 !important;
  background: #dafbe1 !important;
  border-color: #4ac26b !important;
}

html[data-theme="light"] .header-notify-btn,
html[data-theme="light"] .header-user-chip {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .header-notify-btn:hover,
html[data-theme="light"] .header-user-chip:hover {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-accent) !important;
}

html[data-theme="light"] .header-user-name {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .header-user-meta {
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .header-user-chip.is-guest .header-user-meta {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .header-submission-notify-badge,
html[data-theme="light"] .header-notify-badge,
html[data-theme="light"] .chat-fab-badge {
  box-shadow: 0 0 0 2px var(--rf4-bg-elevated);
}

html[data-theme="light"] .avatar-xp-ring-bg {
  stroke: var(--rf4-border);
}

/* FAB чата */
html[data-theme="light"] .chat-fab {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 6px 18px var(--rf4-shadow);
}

html[data-theme="light"] .chat-fab:hover {
  border-color: var(--rf4-accent) !important;
  box-shadow: 0 8px 22px var(--rf4-shadow), 0 0 0 3px var(--rf4-accent-soft);
}

/* ============================================
   LIGHT THEME — таблица рекордов, статы шапки, toast
   ============================================ */

/* Архив рекордов: строки были чёрными из-за более специфичного правила */
html[data-theme="light"] .tab-content-records .records-history-table thead th,
html[data-theme="light"] .tab-content-records .records-table thead th,
html[data-theme="light"] .records-history-table thead th {
  background: var(--rf4-bg-muted) !important;
  color: var(--rf4-text-muted) !important;
  box-shadow: 0 1px 0 0 var(--rf4-border);
}

html[data-theme="light"] .tab-content-records .records-history-table tbody td,
html[data-theme="light"] .tab-content-records .records-table tbody td,
html[data-theme="light"] .records-history-table tbody td,
html[data-theme="light"] .records-table tbody td {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-bottom-color: var(--rf4-border) !important;
}

html[data-theme="light"] .tab-content-records .records-history-table tbody tr:hover td,
html[data-theme="light"] .tab-content-records .records-table tbody tr:hover td,
html[data-theme="light"] .records-history-table tbody tr:hover td {
  background: rgba(9, 105, 218, 0.08) !important;
}

html[data-theme="light"] .rec-td,
html[data-theme="light"] .rec-td-weight,
html[data-theme="light"] .rec-td-bait,
html[data-theme="light"] .rec-fish-name,
html[data-theme="light"] .rec-fish-hub-name,
html[data-theme="light"] .records-summary-line strong,
html[data-theme="light"] .records-history-table .rec-td-sm {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .rec-td-location-link,
html[data-theme="light"] .records-history-table .rec-td-fish-points,
html[data-theme="light"] .records-table .rec-td-fish-points {
  color: var(--rf4-accent) !important;
}

html[data-theme="light"] .records-history-table .rf4-cross-link-btn--icon .rf4-cross-link-icon-img,
html[data-theme="light"] .records-table .rf4-cross-link-btn--icon .rf4-cross-link-icon-img,
html[data-theme="light"] .records-history-table .rf4-icon-dual-img,
html[data-theme="light"] .records-table .rf4-icon-dual-img {
  filter: invert(1);
}

/* Чипы статистики в шапке: числа были белыми на светлом фоне */
html[data-theme="light"] .header-stat-chip {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .header-stat-label {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .header-stat-value {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .header-stat-chip--online {
  background: #dafbe1 !important;
  border-color: #4ac26b !important;
}

html[data-theme="light"] .header-stat-chip--online .header-stat-label {
  color: #1a7f37 !important;
}

html[data-theme="light"] .header-stat-chip--online .header-stat-value {
  color: #1a7f37 !important;
}

/* Уведомления (toast): чёрный текст на жёлтом фоне */
html[data-theme="light"] .toast-notify,
html[data-theme="light"] .toast-notify.warning {
  background: #fae17d !important;
  color: #1f2328 !important;
  box-shadow: 0 4px 14px rgba(31, 35, 40, 0.18);
}

html[data-theme="light"] .toast-notify-inner {
  color: #1f2328 !important;
  background: transparent !important;
}

html[data-theme="light"] .toast-notify.error {
  background: #ffcecb !important;
  color: #82071e !important;
}

html[data-theme="light"] .toast-notify.error .toast-notify-inner {
  color: #82071e !important;
}

/* Карточки локаций: заголовки/текст не белые */
html[data-theme="light"] .card-title,
html[data-theme="light"] .card-stats,
html[data-theme="light"] .card-stat-label,
html[data-theme="light"] .card-price-label,
html[data-theme="light"] .card-meta {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .card-stat-label,
html[data-theme="light"] .card-price-label {
  color: var(--rf4-text-muted) !important;
}

/* Карта: координаты, линейка, зум — светлые, текст чёрный */
html[data-theme="light"] .map-coords-display,
html[data-theme="light"] .detail-map-ruler-btn,
html[data-theme="light"] .distance-ruler-zoom-btn,
html[data-theme="light"] .diary-map-zoom-btn,
html[data-theme="light"] .submission-map-area .submission-map-coords-display,
html[data-theme="light"] .diary-map-coords,
html[data-theme="light"] .distance-ruler-coords-display {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 2px 8px var(--rf4-shadow);
}

html[data-theme="light"] .detail-map-ruler-btn:hover,
html[data-theme="light"] .distance-ruler-zoom-btn:hover:not(:disabled),
html[data-theme="light"] .diary-map-zoom-btn:hover:not(:disabled) {
  background: var(--rf4-bg-muted) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-accent) !important;
}

html[data-theme="light"] .map-coords-accuracy-btn {
  background: var(--rf4-bg-elevated) !important;
  color: #9a6700 !important;
  border-color: #d4a72c !important;
  box-shadow: 0 2px 8px var(--rf4-shadow);
}

html[data-theme="light"] .map-coords-accuracy-btn:hover,
html[data-theme="light"] .map-coords-accuracy-btn:focus-visible {
  background: #fff8c5 !important;
  color: #7d4e00 !important;
  border-color: #bf8700 !important;
}

html[data-theme="light"] .map-coords-accuracy-tip {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: #d4a72c !important;
  box-shadow: 0 6px 20px var(--rf4-shadow);
}

/* ============================================
   LIGHT THEME — энциклопедия (модалка рыбы)
   ============================================ */

html[data-theme="light"] .encyclopedia-fish-modal-content,
html[data-theme="light"] .encyclopedia-fish-modal .modal-content {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
  box-shadow: 0 16px 48px var(--rf4-shadow);
}

html[data-theme="light"] .encyclopedia-fish-modal-content .modal-close-btn,
html[data-theme="light"] .modal-close-btn {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: 0 0 0 3px var(--rf4-bg-elevated), 0 2px 8px var(--rf4-shadow);
}

html[data-theme="light"] .modal-close-btn:hover {
  background: var(--rf4-bg-muted) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-accent) !important;
}

html[data-theme="light"] .efm-hero {
  background: linear-gradient(135deg, #f6f8fa 0%, #ffffff 55%, #eef2f6 100%) !important;
  border-bottom-color: var(--rf4-border) !important;
}

html[data-theme="light"] .efm-hero-media {
  background: var(--rf4-bg) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: none;
}

html[data-theme="light"] .efm-title,
html[data-theme="light"] .efm-water-name,
html[data-theme="light"] .efw-grid-value,
html[data-theme="light"] .efw-strip-value,
html[data-theme="light"] .efm-economy-rank,
html[data-theme="light"] .efm-economy-metrics dd,
html[data-theme="light"] .efm-point-loc,
html[data-theme="light"] .efm-loc-card,
html[data-theme="light"] .rec-fish-hub-name {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .efm-rarity {
  color: var(--rf4-text) !important;
  background: var(--rf4-accent-soft) !important;
  border-color: rgba(9, 105, 218, 0.35) !important;
}

html[data-theme="light"] .efm-tabs {
  background: var(--rf4-bg-muted) !important;
  border-bottom-color: var(--rf4-border) !important;
}

html[data-theme="light"] .efm-tab {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .efm-tab:hover {
  color: var(--rf4-text) !important;
  background: rgba(9, 105, 218, 0.06) !important;
}

html[data-theme="light"] .efm-tab.is-active {
  color: var(--rf4-text) !important;
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  box-shadow: inset 0 2px 0 var(--rf4-accent);
}

html[data-theme="light"] .efm-tab-panels,
html[data-theme="light"] .efm-body {
  background: var(--rf4-bg) !important;
  color: var(--rf4-text);
}

html[data-theme="light"] .efm-card,
html[data-theme="light"] .efm-rig,
html[data-theme="light"] .efm-stat,
html[data-theme="light"] .efm-economy-card,
html[data-theme="light"] .efm-point-card,
html[data-theme="light"] .efm-points-loading,
html[data-theme="light"] .efm-points-empty,
html[data-theme="light"] .gb-panel,
html[data-theme="light"] .gb-table-wrap {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .efm-block-title,
html[data-theme="light"] .efm-card h4,
html[data-theme="light"] .efm-stat-label,
html[data-theme="light"] .efw-strip-label,
html[data-theme="light"] .efw-grid-label,
html[data-theme="light"] .efm-economy-metrics dt,
html[data-theme="light"] .efm-loc-legend,
html[data-theme="light"] .efm-loc-empty,
html[data-theme="light"] .efm-point-meta,
html[data-theme="light"] .efm-point-snippet,
html[data-theme="light"] .efm-pill strong {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .efm-about,
html[data-theme="light"] .efm-waters-text,
html[data-theme="light"] .efm-rig-list,
html[data-theme="light"] .efm-tips-list,
html[data-theme="light"] .efm-pill {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .efm-pill {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .efw-strip-item {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .efw-trophy,
html[data-theme="light"] .efw-hero-trophies .efw-trophy {
  background: var(--rf4-bg-elevated) !important;
}

html[data-theme="light"] .efm-loc-card {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .efm-loc-card:hover {
  background: var(--rf4-bg-muted) !important;
  border-color: var(--rf4-accent) !important;
}

html[data-theme="light"] .efm-action-btn {
  background: var(--rf4-bg-elevated) !important;
}

html[data-theme="light"] .efm-cross-links-host .rf4-cross-link-btn--icon .rf4-cross-link-icon-img,
html[data-theme="light"] .efm-cross-links-host .rf4-icon-dual-img,
html[data-theme="light"] .efm-tab-icon img {
  filter: invert(1);
}

html[data-theme="light"] .efm-tab-panels,
html[data-theme="light"] .encyclopedia-fish-modal-body,
html[data-theme="light"] .encyclopedia-fish-modal-content {
  scrollbar-color: #afb8c1 var(--rf4-bg-muted);
}

/* ============================================
   LIGHT THEME — скроллы глобально + прочие модалки
   ============================================ */

html[data-theme="light"] {
  scrollbar-color: #afb8c1 #eaeef2;
}

html[data-theme="light"] .tab-content-inner,
html[data-theme="light"] .records-table-wrap,
html[data-theme="light"] .reels-table-wrap,
html[data-theme="light"] .rods-table-wrap,
html[data-theme="light"] .hooks-table-wrap,
html[data-theme="light"] .trophies-table-wrap,
html[data-theme="light"] .new-at-startup-list,
html[data-theme="light"] .notify-form-points-list,
html[data-theme="light"] .settings-nav,
html[data-theme="light"] .settings-main,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .records-modal-table-wrap,
html[data-theme="light"] .notify-management-locations,
html[data-theme="light"] .records-points-list,
html[data-theme="light"] .points-fish-dropdown-list,
html[data-theme="light"] .records-combo-list,
html[data-theme="light"] .post-modal-body,
html[data-theme="light"] .points-list,
html[data-theme="light"] .today-feed-scroll,
html[data-theme="light"] .efm-tab-panels,
html[data-theme="light"] .cards-scroll,
html[data-theme="light"] .chat-panel,
html[data-theme="light"] .admin-catalog-table-body {
  scrollbar-color: #afb8c1 #eaeef2 !important;
}

html[data-theme="light"] .tab-content-inner::-webkit-scrollbar-track,
html[data-theme="light"] .records-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .reels-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .rods-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .hooks-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .trophies-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .new-at-startup-list::-webkit-scrollbar-track,
html[data-theme="light"] .notify-form-points-list::-webkit-scrollbar-track,
html[data-theme="light"] .settings-nav::-webkit-scrollbar-track,
html[data-theme="light"] .settings-main::-webkit-scrollbar-track,
html[data-theme="light"] .modal-content::-webkit-scrollbar-track,
html[data-theme="light"] .records-modal-table-wrap::-webkit-scrollbar-track,
html[data-theme="light"] .notify-management-locations::-webkit-scrollbar-track,
html[data-theme="light"] .records-points-list::-webkit-scrollbar-track,
html[data-theme="light"] .points-fish-dropdown-list::-webkit-scrollbar-track,
html[data-theme="light"] .records-combo-list::-webkit-scrollbar-track,
html[data-theme="light"] .post-modal-body::-webkit-scrollbar-track,
html[data-theme="light"] .points-list::-webkit-scrollbar-track,
html[data-theme="light"] .efm-tab-panels::-webkit-scrollbar-track,
html[data-theme="light"] .cards-scroll::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, transparent 0, transparent 5px, #eaeef2 5px, #eaeef2 calc(100% - 5px), transparent calc(100% - 5px)) !important;
}

html[data-theme="light"] .tab-content-inner::-webkit-scrollbar-thumb,
html[data-theme="light"] .records-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .reels-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .rods-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .hooks-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .trophies-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .new-at-startup-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .notify-form-points-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .settings-nav::-webkit-scrollbar-thumb,
html[data-theme="light"] .settings-main::-webkit-scrollbar-thumb,
html[data-theme="light"] .modal-content::-webkit-scrollbar-thumb,
html[data-theme="light"] .records-modal-table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .notify-management-locations::-webkit-scrollbar-thumb,
html[data-theme="light"] .records-points-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .points-fish-dropdown-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .records-combo-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .post-modal-body::-webkit-scrollbar-thumb,
html[data-theme="light"] .points-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .efm-tab-panels::-webkit-scrollbar-thumb,
html[data-theme="light"] .cards-scroll::-webkit-scrollbar-thumb {
  background: #afb8c1 !important;
  border-color: #eaeef2 !important;
}

/* Пост / кафе / гайд — оставшиеся тёмные панели */
html[data-theme="light"] .post-modal-content,
html[data-theme="light"] .post-modal-body,
html[data-theme="light"] .cafe-sidebar,
html[data-theme="light"] .cafe-main,
html[data-theme="light"] .cafe-card,
html[data-theme="light"] .guide-card,
html[data-theme="light"] .diary-panel,
html[data-theme="light"] .wear-panel,
html[data-theme="light"] .skills-panel,
html[data-theme="light"] .analytics-panel,
html[data-theme="light"] .admin-catalog-table,
html[data-theme="light"] .admin-modlog-panel {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .post-modal-text,
html[data-theme="light"] .cafe-status-line,
html[data-theme="light"] .cafe-sidebar-title {
  color: var(--rf4-text) !important;
}

/* Наживки в энциклопедии / аналитике */
html[data-theme="light"] .efm-baits-stats-meta,
html[data-theme="light"] .efm-baits-stats-best,
html[data-theme="light"] .efm-block-sub,
html[data-theme="light"] .analytics-bait-source,
html[data-theme="light"] .analytics-no-data {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .efm-baits-stats-best strong {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .analytics-bait-list,
html[data-theme="light"] .efm-baits-stats-bars {
  color: var(--rf4-text);
}

html[data-theme="light"] .analytics-bait-row {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .analytics-bait-rank {
  color: var(--rf4-text-muted) !important;
}

html[data-theme="light"] .analytics-bait-name {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .analytics-bait-name.is-best {
  color: #9a6700 !important;
}

html[data-theme="light"] .analytics-bait-count {
  color: #1a7f37 !important;
}

html[data-theme="light"] .analytics-bait-bar {
  background: var(--rf4-bg-muted) !important;
}

html[data-theme="light"] .analytics-bait-bar-fill {
  background: linear-gradient(90deg, #bf8700, #2da44e) !important;
}

html[data-theme="light"] .analytics-loc-row,
html[data-theme="light"] .analytics-bar-row {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .analytics-bar-label,
html[data-theme="light"] .analytics-loc-name {
  color: var(--rf4-text) !important;
}

/* Админка: карточки/поиск без серого «грязного» фона */
html[data-theme="light"] .admin-user-card,
html[data-theme="light"] .admin-hidden-item,
html[data-theme="light"] .admin-modlog-item,
html[data-theme="light"] .admin-support-list-col,
html[data-theme="light"] .admin-support-thread-col,
html[data-theme="light"] .admin-search-input,
html[data-theme="light"] .admin-modlog-filter,
html[data-theme="light"] .admin-modlog-post-id,
html[data-theme="light"] .admin-page-num,
html[data-theme="light"] .admin-tab,
html[data-theme="light"] .admin-modlog-tab,
html[data-theme="light"] .admin-catalog-table,
html[data-theme="light"] .admin-catalog-icon-btn {
  background: var(--rf4-bg-elevated) !important;
  color: var(--rf4-text) !important;
  border-color: var(--rf4-border) !important;
}

html[data-theme="light"] .admin-tab.is-active,
html[data-theme="light"] .admin-page-num.is-active {
  background: #1a7f37 !important;
  border-color: #1a7f37 !important;
  color: #fff !important;
}

html[data-theme="light"] .admin-users-pagination {
  background: var(--rf4-bg) !important;
  border-top-color: var(--rf4-border) !important;
}

/* Недоступные достижения — светлый «заглушенный» вид */
html[data-theme="light"] .user-profile-panel .account-achievement-card.is-locked {
  background: linear-gradient(165deg, #f4f6f8 0%, #e9eef3 100%) !important;
  border: 1px dashed #c7d0d9 !important;
  opacity: 1 !important;
  filter: grayscale(0.45) saturate(0.75);
  box-shadow: inset 0 0 0 1px rgba(31, 35, 40, 0.03);
}

html[data-theme="light"] .user-profile-panel .account-achievement-card.is-locked .account-achievement-name {
  color: #424a53 !important;
}

html[data-theme="light"] .user-profile-panel .account-achievement-card.is-locked .account-achievement-hint {
  color: #656d76 !important;
}

html[data-theme="light"] .user-profile-panel .account-achievement-card.is-locked .account-achievement-icon-wrap {
  background: #eef1f4 !important;
  border-color: #d0d7de !important;
  box-shadow: none !important;
}

html[data-theme="light"] .user-profile-panel .account-achievement-card.is-locked .account-achievement-icon-wrap::after {
  background: #ffffff !important;
  border-color: #d0d7de !important;
  box-shadow: 0 1px 3px rgba(31, 35, 40, 0.1);
}

html[data-theme="light"] .user-profile-panel .account-achievement-card.is-unlocked {
  background: linear-gradient(165deg, rgba(9, 105, 218, 0.08), #ffffff 55%) !important;
  border-color: rgba(9, 105, 218, 0.35) !important;
}

html[data-theme="light"] .achievement-preview-content.is-locked .achievement-preview-icon-wrap {
  filter: grayscale(0.4);
  opacity: 0.85;
  background: #eef1f4;
}

/* Бейджи ролей / онлайн — светлые пастельные подписи */
html[data-theme="light"] .admin-badge-role-admin,
html[data-theme="light"] .user-profile-role-badge.is-admin,
html[data-theme="light"] .chat-message-role-badge.is-admin {
  background: #fff8c5 !important;
  border: 1px solid #d4a72c !important;
  color: #7d4e00 !important;
}

html[data-theme="light"] .admin-badge-role-moderator,
html[data-theme="light"] .user-profile-role-badge.is-moderator,
html[data-theme="light"] .chat-message-role-badge.is-moderator {
  background: #ddf4ff !important;
  border: 1px solid #54aeff !important;
  color: #0550ae !important;
}

html[data-theme="light"] .admin-badge-online {
  background: #dafbe1 !important;
  border: 1px solid #4ac26b !important;
  color: #116329 !important;
}

html[data-theme="light"] .admin-badge-blocked {
  background: #ffebe9 !important;
  border: 1px solid #ff8182 !important;
  color: #a40e26 !important;
}

html[data-theme="light"] .admin-badge-chat-banned {
  background: #fff1e5 !important;
  border: 1px solid #fb8f44 !important;
  color: #9a6700 !important;
}

html[data-theme="light"] .admin-badge-role-user {
  background: #f6f8fa !important;
  border: 1px solid #d0d7de !important;
  color: #656d76 !important;
}

html[data-theme="light"] .settings-game-firewall-item {
  background: var(--rf4-bg-elevated) !important;
  border-color: var(--rf4-border) !important;
  color: var(--rf4-text) !important;
  box-shadow: 0 1px 2px var(--rf4-shadow);
}

html[data-theme="light"] .settings-game-firewall-item-label {
  color: var(--rf4-text) !important;
}

html[data-theme="light"] .settings-game-firewall-admin.warn {
  color: #9a6700 !important;
}

html[data-theme="light"] .settings-game-firewall-admin.ok {
  color: #1a7f37 !important;
}

/* Настройки: селекты/поля — белые, не «серые мыльные» */
html[data-theme="light"] .settings-panel select,
html[data-theme="light"] #settingsModal select,
html[data-theme="light"] .settings-input-num,
html[data-theme="light"] .settings-panel input[type="text"],
html[data-theme="light"] .settings-panel input[type="number"],
html[data-theme="light"] .settings-panel input[type="search"] {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #1f2328 !important;
  border: 1px solid #afb8c1 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.06);
  font-weight: 500;
}

html[data-theme="light"] .settings-panel select,
html[data-theme="light"] #settingsModal select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23424a53' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.6rem center !important;
  padding: 0.4rem 1.85rem 0.4rem 0.7rem !important;
  min-height: 2.15rem;
}

html[data-theme="light"] .settings-panel select:hover,
html[data-theme="light"] #settingsModal select:hover {
  border-color: #0969da !important;
  background-color: #ffffff !important;
}

html[data-theme="light"] .settings-panel select:focus,
html[data-theme="light"] #settingsModal select:focus {
  outline: none;
  border-color: #0969da !important;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.18);
}

html[data-theme="light"] .settings-row {
  background: transparent !important;
  border-bottom-color: #d8dee4 !important;
}

html[data-theme="light"] .settings-panel-desc {
  color: #656d76 !important;
}

html[data-theme="light"] .settings-subsection-title {
  color: #1f2328 !important;
  font-weight: 700;
}

/* Модалка «Добавить подписку» — светлая и читаемая */
html[data-theme="light"] .cafe-watch-add-modal-content {
  background: #ffffff !important;
  border-color: #d0d7de !important;
  box-shadow: 0 16px 48px rgba(31, 35, 40, 0.18) !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-select,
html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-fish-trigger {
  background: #ffffff !important;
  border-color: #afb8c1 !important;
  color: #1f2328 !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-list {
  background: #ffffff !important;
  border-color: #d0d7de !important;
  box-shadow: 0 12px 32px rgba(31, 35, 40, 0.16) !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-option {
  color: #1f2328 !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-option:hover,
html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-fish-dropdown .points-fish-dropdown-option:focus {
  background: rgba(9, 105, 218, 0.1) !important;
  color: #0550ae !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-add-notify {
  background: #f6f8fa !important;
  border-color: #d0d7de !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-check--chip {
  background: #ffffff !important;
  border-color: #d0d7de !important;
  color: #1f2328 !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-check--chip:has(input:checked) {
  background: #dafbe1 !important;
  border-color: #4ac26b !important;
  color: #116329 !important;
}

html[data-theme="light"] .cafe-watch-add-modal .cafe-watch-secondary-btn {
  background: #ffffff !important;
  border-color: #afb8c1 !important;
  color: #1f2328 !important;
}

/* ========== Барахолка ========== */
.tab-content-bazaar {
  height: 100%;
  min-height: 0;
}

.bazaar-layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  min-height: 0;
  padding: 0.25rem 0.15rem 1rem;
}

.bazaar-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.bazaar-head-sub {
  margin: 0.35rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.9rem;
  max-width: 42rem;
  line-height: 1.45;
}

.bazaar-create-btn {
  flex-shrink: 0;
}

.bazaar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-top: 0.75rem;
}

.bazaar-filters,
.bazaar-want-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bazaar-filter,
.bazaar-chip {
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  color: var(--rf4-text-soft);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  font-size: 0.84rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.bazaar-filter:hover,
.bazaar-chip:hover {
  border-color: var(--rf4-accent);
}

.bazaar-filter.is-active,
.bazaar-chip.is-active {
  background: var(--rf4-accent-soft);
  border-color: var(--rf4-accent);
  color: var(--rf4-accent);
}

.bazaar-search {
  margin-left: auto;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  border-radius: 10px;
  padding: 0.42rem 0.75rem;
  font-size: 0.88rem;
}

.bazaar-error,
.bazaar-form-error {
  color: #ffa198;
  font-size: 0.9rem;
  margin: 0;
}

.bazaar-empty {
  color: var(--rf4-text-muted);
  margin: 1.5rem 0 0;
  text-align: center;
}

.bazaar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
  overflow: auto;
  min-height: 0;
  padding: 0.15rem 0.15rem 0.75rem;
}

.bazaar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--rf4-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bazaar-card:hover {
  transform: translateY(-3px);
  border-color: var(--rf4-accent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

.bazaar-card.is-sold,
.bazaar-card.is-closed {
  opacity: 0.72;
}

.bazaar-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--rf4-bg-muted);
  overflow: hidden;
}

.bazaar-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.bazaar-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--rf4-text-muted, rgba(255, 255, 255, 0.45));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 55%),
    var(--rf4-bg-muted, #2a2a2e);
  opacity: 1;
}

.bazaar-card-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.bazaar-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.bazaar-card-dot.is-on {
  background: #fff;
  transform: scale(1.15);
}

.bazaar-card-qty {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(13, 17, 23, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.bazaar-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.72rem;
  font-weight: 650;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: rgba(35, 134, 54, 0.9);
  color: #fff;
}

.bazaar-card-status.is-sold {
  background: rgba(210, 153, 34, 0.92);
}

.bazaar-card-status.is-closed {
  background: rgba(110, 118, 129, 0.92);
}

.bazaar-card-clients,
.bazaar-card-requested {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 0.72rem;
  font-weight: 650;
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  color: #fff;
}

.bazaar-card-clients {
  background: rgba(248, 81, 73, 0.94);
}

.bazaar-card-requested {
  background: rgba(56, 139, 253, 0.92);
}

.bazaar-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem 0.8rem;
  min-height: 0;
}

.bazaar-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--rf4-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bazaar-card-wants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.bazaar-want-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
  background: var(--rf4-bg);
}

.bazaar-want-badge.is-gold {
  border-color: #d4a72c;
  color: #e3b341;
  background: rgba(210, 153, 34, 0.12);
}

.bazaar-want-badge.is-premium {
  border-color: #a371f7;
  color: #d2a8ff;
  background: rgba(163, 113, 247, 0.12);
}

.bazaar-card-seller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.bazaar-card-nick {
  font-weight: 650;
  color: var(--rf4-text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bazaar-copy-nick {
  flex-shrink: 0;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
  color: var(--rf4-accent);
  border-radius: 8px;
  padding: 0.18rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
}

.bazaar-copy-nick:hover {
  border-color: var(--rf4-accent);
  background: var(--rf4-accent-soft);
}

.bazaar-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bazaar-modal[hidden] {
  display: none !important;
}

.bazaar-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.72);
}

.bazaar-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 96vw);
  max-height: min(92vh, 920px);
  overflow: auto;
  background: var(--rf4-bg);
  border: 1px solid var(--rf4-border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  padding: 1.15rem 1.35rem 1.35rem;
}

.bazaar-modal-panel--detail {
  width: min(1280px, 98vw);
  height: min(90vh, 920px);
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--rf4-bg);
}

.bazaar-modal-head--overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  margin: 0;
  padding: 0.85rem 0.95rem 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(1, 4, 9, 0.55), transparent);
}

.bazaar-modal-head--overlay h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.bazaar-modal-head--overlay .bazaar-modal-close {
  pointer-events: auto;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.62);
  backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.bazaar-modal-head--overlay .bazaar-modal-close:hover {
  background: rgba(13, 17, 23, 0.88);
}

.bazaar-detail-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.bazaar-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.bazaar-modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.bazaar-modal-sub {
  margin: 0.3rem 0 0;
  color: var(--rf4-text-muted);
  font-size: 0.85rem;
}

.bazaar-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--rf4-bg-muted);
  color: var(--rf4-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.bazaar-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.bazaar-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
}

.bazaar-field--wide {
  grid-column: 1 / -1;
}

.bazaar-field input,
.bazaar-field textarea,
.bazaar-search {
  font: inherit;
}

.bazaar-field input,
.bazaar-field textarea {
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text);
  border-radius: 10px;
  padding: 0.48rem 0.7rem;
}

.bazaar-fieldset {
  margin: 0.9rem 0 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rf4-border);
  border-radius: 12px;
}

.bazaar-fieldset legend {
  padding: 0 0.35rem;
  color: var(--rf4-text-soft);
  font-size: 0.85rem;
}

.bazaar-want-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bazaar-want-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--rf4-text-soft);
}

.bazaar-want-pick:has(input:checked) {
  border-color: var(--rf4-accent);
  background: var(--rf4-accent-soft);
  color: var(--rf4-accent);
}

.bazaar-photos-block {
  margin-top: 0.7rem;
}

.bazaar-photos-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--rf4-text-muted);
  margin-bottom: 0.45rem;
}

.bazaar-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.bazaar-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg-elevated);
}

.bazaar-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bazaar-photo-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.78);
  color: #f85149;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.bazaar-photos-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.4rem 0.8rem;
  border: 1px dashed var(--rf4-border);
  border-radius: 10px;
  color: var(--rf4-accent);
  cursor: pointer;
}

.bazaar-photos-add:hover .bazaar-photos-add-btn {
  border-color: var(--rf4-accent);
  background: var(--rf4-accent-soft);
}

.bazaar-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1rem;
}

.bazaar-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 380px);
  height: 100%;
  min-height: 0;
}

.bazaar-detail-gallery {
  min-width: 0;
  min-height: 0;
  background: #05070b;
}

.bazaar-detail-hero {
  position: relative;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 20%, rgba(88, 166, 255, 0.08), transparent 55%),
    #05070b;
  border: none;
}

.bazaar-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  display: block;
  cursor: zoom-in;
}

.bazaar-detail-hero .bazaar-card-placeholder {
  min-height: 100%;
}

.bazaar-detail-count,
.bazaar-detail-zoom {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.62);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.bazaar-detail-count {
  top: 18px;
  left: 18px;
  padding: 0.32rem 0.7rem;
}

.bazaar-detail-zoom {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.32rem 0.75rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.bazaar-detail-hero:hover .bazaar-detail-zoom {
  opacity: 1;
}

.bazaar-detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.58);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bazaar-detail-hero:hover .bazaar-detail-nav,
.bazaar-detail-nav:focus-visible {
  opacity: 1;
}

.bazaar-detail-nav:hover {
  background: rgba(13, 17, 23, 0.88);
  transform: translateY(-50%) scale(1.06);
}

.bazaar-detail-nav.prev { left: 14px; }
.bazaar-detail-nav.next { right: 14px; }

.bazaar-detail-thumbs {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  max-width: calc(100% - 2rem);
  overflow: auto;
  padding: 0.35rem;
  border-radius: 14px;
  background: rgba(13, 17, 23, 0.55);
  backdrop-filter: blur(12px);
  z-index: 2;
}

.bazaar-detail-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--rf4-bg-muted);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.72;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.bazaar-detail-thumb:hover {
  opacity: 1;
}

.bazaar-detail-thumb.is-on {
  border-color: #fff;
  opacity: 1;
  transform: translateY(-2px);
}

.bazaar-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bazaar-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  overflow: auto;
  padding: 1.35rem 1.2rem 1.2rem;
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.65), var(--rf4-bg));
  border-left: 1px solid var(--rf4-border);
}

.bazaar-detail-info-top {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.bazaar-detail-info h4 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.bazaar-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.bazaar-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.12rem 0.62rem;
  border-radius: 999px;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  color: var(--rf4-text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.bazaar-pill.is-status.is-active {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.12);
}

.bazaar-pill.is-status.is-sold {
  color: #e3b341;
  border-color: rgba(210, 153, 34, 0.4);
  background: rgba(210, 153, 34, 0.14);
}

.bazaar-pill.is-status.is-closed {
  color: var(--rf4-text-muted);
}

.bazaar-detail-comment {
  white-space: pre-wrap;
  color: var(--rf4-text-soft);
  line-height: 1.5;
  background: var(--rf4-bg-elevated);
  border: 1px solid var(--rf4-border);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  margin: 0;
}

.bazaar-detail-seller {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(88, 166, 255, 0.22);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.12), var(--rf4-bg-elevated));
  margin-top: auto;
}

.bazaar-detail-seller-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.bazaar-detail-seller-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #58a6ff, #1f6feb);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}

.bazaar-detail-seller-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.08rem;
}

.bazaar-detail-seller-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rf4-text-muted);
}

.bazaar-detail-seller-nick {
  font-size: 1.02rem;
  font-weight: 750;
  color: var(--rf4-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bazaar-detail-seller-lvl {
  font-size: 0.8rem;
  color: var(--rf4-text-muted);
}

.bazaar-copy-nick--wide {
  width: 100%;
  justify-content: center;
  padding: 0.58rem 0.85rem;
  font-size: 0.92rem;
  border-radius: 12px;
  background: #238636;
  color: #fff;
  border: none;
}

.bazaar-copy-nick--wide:hover {
  background: #2ea043;
  border-color: transparent;
}

.bazaar-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.bazaar-detail-actions .btn-danger {
  grid-column: 1 / -1;
}

.bazaar-inbox,
.bazaar-outgoing {
  border: 1px solid var(--rf4-border);
  background: linear-gradient(180deg, rgba(248, 81, 73, 0.08), var(--rf4-bg-elevated));
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
}

.bazaar-inbox {
  border-color: rgba(248, 81, 73, 0.45);
  box-shadow: 0 0 0 1px rgba(248, 81, 73, 0.12), 0 6px 18px rgba(248, 81, 73, 0.08);
}

.bazaar-inbox-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 750;
  color: #ff7b72;
}

html[data-theme="light"] .bazaar-inbox-title {
  color: #cf222e;
}

.bazaar-outgoing {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.08), var(--rf4-bg-elevated));
}

.bazaar-inbox-hint {
  margin: 0.3rem 0 0.7rem;
  color: var(--rf4-text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.bazaar-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 240px;
  overflow: auto;
}

.bazaar-inbox-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--rf4-border);
  background: var(--rf4-bg);
}

.bazaar-inbox-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.bazaar-inbox-nick {
  color: var(--rf4-text-soft);
  font-size: 0.85rem;
}

.bazaar-inbox-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bazaar-detail-trade {
  margin-top: 0;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.08);
}

.bazaar-detail-trade p {
  margin: 0 0 0.65rem;
  color: var(--rf4-text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.bazaar-detail-trade.is-owner {
  border-color: rgba(248, 81, 73, 0.35);
  background: rgba(248, 81, 73, 0.08);
}

@media (max-width: 760px) {
  .bazaar-form-grid,
  .bazaar-detail {
    grid-template-columns: 1fr;
  }
  .bazaar-search {
    margin-left: 0;
    max-width: none;
  }
  .bazaar-modal-panel--detail {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .bazaar-detail-hero {
    min-height: 52vh;
  }
  .bazaar-detail-gallery {
    min-height: 52vh;
  }
  .bazaar-detail-body {
    overflow: auto;
  }
  .bazaar-detail {
    height: auto;
  }
  .bazaar-detail-info {
    border-left: none;
    border-top: 1px solid var(--rf4-border);
  }
  .bazaar-detail-zoom {
    display: none;
  }
  .bazaar-detail-nav {
    opacity: 1;
  }
}

html[data-theme="light"] .bazaar-card,
html[data-theme="light"] .bazaar-modal-panel,
html[data-theme="light"] .bazaar-field input,
html[data-theme="light"] .bazaar-field textarea,
html[data-theme="light"] .bazaar-search,
html[data-theme="light"] .bazaar-detail-comment,
html[data-theme="light"] .bazaar-detail-seller,
html[data-theme="light"] .bazaar-detail-info,
html[data-theme="light"] .bazaar-pill {
  background: var(--rf4-bg-elevated);
  border-color: var(--rf4-border);
  color: var(--rf4-text);
}

html[data-theme="light"] .bazaar-detail-hero {
  background: #e8eef4;
}

html[data-theme="light"] .bazaar-detail-hero img {
  background: transparent;
}

html[data-theme="light"] .bazaar-detail-info {
  background: var(--rf4-bg);
}

html[data-theme="light"] .bazaar-card-qty {
  background: rgba(255, 255, 255, 0.88);
  color: #1f2328;
}

html[data-theme="light"] .bazaar-want-badge.is-gold {
  color: #84570a;
}

html[data-theme="light"] .bazaar-want-badge.is-premium {
  color: #8250df;
}

