:root {
  --ll-sidebar-width: 260px;
}

/* Legacy layout vars — visual theme in etiya-theme.css */

.wrapper {
  min-height: 100vh;
}

.sidebar {
  width: var(--ll-sidebar-width);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  padding: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.25rem;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.brand__title {
  color: #e2e8f0;
  font-weight: 700;
}

.brand__sub {
  color: #94a3b8;
  font-size: 0.8rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
  margin-bottom: 6px;
}

.nav-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-group__toggle:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
}

.nav-group__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-group__icon {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
}

.nav-group__label {
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
}

.nav-group__chevron {
  font-size: 0.62rem;
  transition: transform 0.2s ease;
}

.nav-group.is-collapsed .nav-group__chevron {
  transform: rotate(-90deg);
}

.nav-group__items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 2px 0 8px;
  margin-left: calc(0.75rem + 9px);
  padding: 0 0 0 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  max-height: 520px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}

.nav-group.is-collapsed .nav-group__items {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  border-left-color: transparent;
  pointer-events: none;
}

.nav-group__items .nav__btn {
  min-height: 36px;
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
}

.nav__btn {
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: transparent;
  color: #cbd5e1;
  width: 100%;
  min-height: 40px;
  text-align: left;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  transition: 0.15s ease;
}

.nav__btn:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
}

.nav__btn.is-active {
  color: #fff;
  background: rgba(37, 99, 235, 0.18);
  border-left-color: #2697ff;
}

.sidebar__note {
  margin-top: auto;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #94a3b8;
}

.content {
  padding: 1.2rem;
}

.view {
  display: none;
}

.view--active {
  display: block;
}

.main__header {
  margin-bottom: 1rem;
}

.main__header h1 {
  margin: 0;
}

.main__header--row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
}

.card {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  background: #ffffff;
}

.card p {
  margin: 0 0 0.55rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  font-weight: 600;
}

.btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  color: #ffffff;
}

.btn--ghost {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn--ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn--danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.btn--sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cat-tab {
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.48rem 0.85rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.cat-tab::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-tab[data-cat="no_fishing"]::before {
  background: rgba(244, 67, 54, 0.4);
  box-shadow: inset 0 0 0 1.5px #f44336;
}

.cat-tab[data-cat="reserve"]::before {
  background: rgba(76, 175, 80, 0.4);
  box-shadow: inset 0 0 0 1.5px #4caf50;
}

.cat-tab[data-cat="winter_pit"]::before {
  background: rgba(63, 56, 255, 0.42);
  box-shadow: inset 0 0 0 1.5px #3f38ff;
}

.cat-tab[data-cat="border_zone"]::before {
  background: #9c27b0;
  border-radius: 2px;
  width: 12px;
  height: 3px;
}

.cat-tab.is-active {
  color: #0f172a;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.14);
}

.zones-layout {
  display: grid;
  grid-template-columns: minmax(420px, 2fr) minmax(560px, 1fr);
  gap: 1rem;
  align-items: start;
}

.fish-points-intro {
  margin: 0 0 0.7rem;
}

.zone-list__item--active {
  border-color: #557af5;
  background: rgba(85, 122, 245, 0.08);
}

.map-wrap {
  min-height: 0;
  position: relative;
}

.map {
  min-height: calc(100vh - 210px);
  height: calc(100vh - 210px);
  border-radius: 12px;
  border: 1px solid #dbe3ef;
}

.map--viewer {
  min-height: calc(100vh - 210px);
  height: calc(100vh - 210px);
}

.viewer-map-wrap {
  position: relative;
}

.map-base-layer-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--color-secondary, #2a2d3e);
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 500;
}

.map-base-layer-switch--float {
  position: absolute;
  top: 12px;
  right: 12px;
}

.map-base-layer-switch--toolbar {
  margin-left: auto;
  align-self: center;
}

.map-base-layer-btn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-muted, #cbd5e1);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.map-base-layer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.map-base-layer-btn.is-active {
  background: var(--color-primary, #2697ff);
  color: #fff;
}

.map-base-layer-btn.is-active:hover {
  background: #1a85e8;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  background: var(--color-secondary, #2a2d3e);
  border: 1px solid var(--color-border-subtle, #dbe3ef);
  border-radius: 12px;
}

.viewer-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--color-text-muted, #cbd5e1);
  cursor: pointer;
}

.viewer-toolbar label::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.viewer-toolbar label:has(.viewer-filter[data-filter="no_fishing"])::before {
  background: rgba(244, 67, 54, 0.4);
  box-shadow: inset 0 0 0 1.5px #f44336;
}

.viewer-toolbar label:has(.viewer-filter[data-filter="reserve"])::before {
  background: rgba(76, 175, 80, 0.4);
  box-shadow: inset 0 0 0 1.5px #4caf50;
}

.viewer-toolbar label:has(.viewer-filter[data-filter="winter_pit"])::before {
  background: rgba(63, 56, 255, 0.42);
  box-shadow: inset 0 0 0 1.5px #3f38ff;
}

.viewer-toolbar label:has(.viewer-filter[data-filter="border_zone"])::before {
  background: #9c27b0;
  border-radius: 2px;
  width: 14px;
  height: 3px;
}

.viewer-toolbar label:has(.viewer-filter[data-filter="fish_points"])::before {
  background: #557af5;
  box-shadow: inset 0 0 0 1.5px #557af5;
}

.zones-side {
  background: var(--color-secondary, #2a2d3e);
  border: 1px solid var(--color-border-subtle, #dbe3ef);
  border-radius: 12px;
  padding: 0.9rem;
  max-height: calc(100vh - 170px);
  overflow: auto;
}

/* Map layers: right block equals map height */
#view-zones .zones-layout {
  align-items: stretch;
}

#view-zones .map-wrap,
#view-zones .zones-side {
  height: calc(100vh - 210px);
}

#view-zones .zones-side {
  max-height: calc(100vh - 210px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#view-zones .zones-side-grid {
  flex: 1;
  min-height: 0;
}

#view-zones .zones-panel--list {
  min-height: 0;
  overflow: auto;
}

/* Fish points: right block equals map height */
.fish-points-layout {
  align-items: stretch;
  gap: 0.85rem;
}

.fish-points-layout .map-wrap,
.fish-points-layout .zones-side {
  height: calc(100vh - 210px);
}

.fish-points-layout .map-wrap {
  display: flex;
  flex-direction: column;
}

.fish-points-layout .map {
  flex: 1;
  min-height: 0;
}

.fish-points-layout .map-hint {
  margin: 0.45rem 0 0;
  padding: 0 0.1rem;
}

.fish-points-layout .zones-side {
  max-height: calc(100vh - 210px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fish-points-layout .zones-side-grid {
  flex: 1;
  min-height: 0;
}

.fish-points-layout .zones-panel--list {
  min-height: 0;
  overflow: auto;
}

#view-fish-points .moderation-card {
  margin-top: 0.75rem;
  padding: 0;
  overflow: hidden;
}

#view-fish-points .fish-points-table-controls {
  padding: 0.75rem 0.8rem;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border-subtle, #dbe3ef);
}

#view-fish-points .fish-points-table-controls .posts-filter {
  min-width: 170px;
}

#view-fish-points #fish-points-region-filter {
  padding: 0;
}

#view-fish-points .fish-points-region-trigger {
  width: 100%;
  min-width: 170px;
  border: none;
  border-radius: 8px;
  padding: 0.48rem 0.6rem;
  background: transparent;
  color: var(--color-text, #fff);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

#view-fish-points .fish-points-region-trigger::after {
  content: "▼";
  float: right;
  font-size: 0.72em;
  opacity: 0.85;
  margin-top: 0.15em;
}

#view-fish-points .moderation-table-wrap {
  border: 0;
  border-radius: 0;
}

.zones-side-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr);
  gap: 0.8rem;
}

.zones-panel {
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 0.8rem;
  background: var(--color-bg, #212332);
}

.zone-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.zone-list__item {
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.15);
  color: var(--color-text, #fff);
}

.zone-list__title {
  font-weight: 600;
}

.zone-list__meta {
  font-size: 0.78rem;
  color: var(--color-text-muted, #94a3b8);
}

.zone-list__actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.zone-list__actions button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 0.28rem 0.55rem;
}

.zone-list__actions .is-danger {
  border-color: #fecaca;
  color: #dc2626;
}

.zone-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.zone-form label {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.82rem;
}

.zone-form input {
  border: 1px solid #d6deeb;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.role-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}

.role-table-wrap {
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
}

.role-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  background: #ffffff;
}

.role-table th,
.role-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.62rem 0.72rem;
  vertical-align: top;
  color: #0f172a;
}

.role-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}

.role-table tr:nth-child(even) td {
  background: #fcfdff;
}

.role-table__btn {
  border: 1px solid #fecaca;
  color: #dc2626;
  background: #fff;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
}

.role-table__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.user-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.83rem;
}

.user-form input {
  border: 1px solid #d6deeb;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.user-form__actions {
  grid-column: 1 / -1;
}

.user-table-wrap {
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
}

.user-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #ffffff;
}

.user-table th,
.user-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.62rem 0.72rem;
  vertical-align: top;
  color: #0f172a;
}

.user-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}

.user-table tr:nth-child(even) td {
  background: #fcfdff;
}

.user-table__btn {
  border: 1px solid #fecaca;
  color: #dc2626;
  background: #fff;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
}

.posts-filter {
  min-width: 180px;
  border: 1px solid var(--color-border-subtle, #d6deeb);
  border-radius: 8px;
  padding: 0.48rem 0.6rem;
  background: var(--color-bg, #212332);
  color: var(--color-text, #fff);
}

.moderation-table-wrap {
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
}

.moderation-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: #ffffff;
}

.moderation-table th,
.moderation-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.62rem 0.72rem;
  vertical-align: top;
  color: #0f172a;
}

.moderation-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}

.moderation-table tr:nth-child(even) td {
  background: #fcfdff;
}

.moderation-table__actions {
  vertical-align: middle;
}

.moderation-table__actions-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Кнопки без обёртки actions-inner */
.moderation-table__actions > .btn {
  margin: 0.15rem 0.4rem 0.15rem 0;
}

.moderation-table--posts {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.moderation-table--posts .moderation-table__col-id {
  width: 9%;
}

.moderation-table--posts .moderation-table__col-author {
  width: 7%;
}

.moderation-table--posts .moderation-table__col-river {
  width: 9%;
}

.moderation-table--posts .moderation-table__col-fish {
  width: 14%;
}

.moderation-table--posts .moderation-table__col-description {
  width: 22%;
}

.moderation-table--posts .moderation-table__col-likes {
  width: 5%;
}

.moderation-table--posts .moderation-table__col-date {
  width: 11%;
}

.moderation-table--posts .moderation-table__col-status {
  width: 8%;
}

.moderation-table--posts .moderation-table__col-actions {
  width: 15%;
}

.moderation-table--posts td:nth-child(4),
.moderation-table--posts td:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moderation-table--posts .moderation-table__actions .btn--sm {
  padding: 0.24rem 0.42rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.moderation-table--posts td:nth-child(8) {
  white-space: nowrap;
}

.moderation-table--posts td:nth-child(8) .post-status {
  width: max-content;
  max-width: 100%;
}

.chat-members-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-members-field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-members-field__label {
  font-size: 0.875rem;
  font-weight: 500;
}

.chat-members-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.chat-member-autocomplete {
  position: relative;
}

.chat-member-suggestions,
#chat-member-suggestions-portal {
  position: fixed;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  z-index: 15000;
}

.chat-member-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.chat-member-suggestion:hover,
.chat-member-suggestion:focus-visible {
  background: rgba(59, 130, 246, 0.1);
  outline: none;
}

.chat-member-suggestion__meta {
  font-size: 0.78rem;
  color: #64748b;
}

.chat-member-suggestions__empty {
  padding: 0.55rem 0.65rem;
}

.chat-members-table input.chat-member-username {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.chat-members-table__actions-col {
  width: 7rem;
}

.modal__dialog--chat {
  max-width: min(96vw, 920px);
  width: min(96vw, 920px);
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-form__grid {
  display: grid;
  gap: 0.75rem;
}

.chat-form__grid--main {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chat-form__grid--media {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.chat-form__field--wide {
  grid-column: 1 / 2;
}

.chat-form__field--full {
  grid-column: 1 / -1;
}

.chat-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.chat-form input,
.chat-form select {
  border: 1px solid #d6deeb;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font: inherit;
}

.chat-form__section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-form__section-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.chat-last-message-panel {
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: rgba(15, 23, 42, 0.04);
}

.chat-last-message-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.chat-last-message-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.chat-last-message-item__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
}

.chat-last-message-item__value {
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

.chat-form__active {
  margin: 0;
}

.chat-form__footer {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

@media (max-width: 860px) {
  .chat-form__grid--main,
  .chat-form__grid--media,
  .chat-last-message-grid {
    grid-template-columns: 1fr;
  }

  .chat-form__field--wide,
  .chat-form__field--full {
    grid-column: 1 / -1;
  }
}

.moderation-card + .moderation-card {
  margin-top: 0.9rem;
}

.content-module__header {
  margin-bottom: 0.7rem;
}

.content-module__title {
  margin: 0;
  font-size: 1.02rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.settings-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.75rem 0;
}

.settings-form .content-module__title {
  margin: 0;
  font-size: 1rem;
}

.settings-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}

.global-settings-save-status {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.global-settings-save-status--ok {
  color: #15803d;
}

.global-settings-save-status--error {
  color: #b91c1c;
}

.post-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.post-status--pending {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.post-status--approved {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.post-status--rejected {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.post-likes-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  white-space: nowrap;
}

.post-likes-heart {
  color: #e53935;
  font-size: 1.05rem;
  line-height: 1;
}

.post-likes-count {
  color: #2e2e2e;
}

.comment-likes-cell {
  display: inline-block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-preview {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-preview p {
  margin: 0;
}

.post-preview--post {
  gap: 0.7rem;
}

.post-preview--post > p:nth-of-type(-n + 8) {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.6rem;
  align-items: baseline;
}

.post-preview--post > p:nth-of-type(-n + 8) strong {
  color: var(--color-text-muted, #94a3b8);
}

.post-preview--post > p:nth-of-type(-n + 8) .post-status {
  justify-self: start;
  width: max-content;
  max-width: 100%;
}

.post-edit-form {
  gap: 0.55rem;
}

.post-edit-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
}

.post-edit-row strong,
.post-edit-section strong {
  color: var(--color-text-muted, #94a3b8);
}

.post-edit-form input,
.post-edit-form select {
  width: 100%;
  border: 1px solid var(--color-border-subtle, #d6deeb);
  border-radius: 8px;
  padding: 0.46rem 0.58rem;
  background: var(--color-bg, #212332);
  color: var(--color-text, #fff);
  font: inherit;
}

.post-edit-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.post-edit-inline input {
  flex: 1;
}

.post-edit-photos {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.post-edit-photo-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-edit-section {
  margin-top: 0.25rem;
}

.post-edit-photos-actions {
  margin-top: 0.15rem;
  margin-bottom: 0.3rem;
}

.post-edit-row--status {
  margin-top: 0.6rem;
  align-items: center;
}

.post-edit-status-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 100%;
}

.post-edit-status-actions #post-edit-status-input {
  flex: 1 1 auto;
  min-width: 220px;
  width: auto;
}

.post-edit-status-actions #btn-post-edit-save {
  flex: 0 0 auto;
  min-width: 170px;
  white-space: nowrap;
}

.post-edit-caught-fish-preview {
  min-height: 38px;
  border: 1px dashed var(--color-border-subtle, #d6deeb);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  background: rgba(0, 0, 0, 0.06);
}

.post-edit-caught-fish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.post-edit-caught-fish-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  padding: 0.15rem 0.45rem;
  font-size: 0.76rem;
  line-height: 1.25;
}

.post-edit-fish-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.post-edit-fish-fields input {
  width: 100%;
  border: 1px solid #d6deeb;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.post-edit-fish-input-group {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 0.4rem;
}

.post-edit-fish-unit {
  border: 1px solid #d6deeb;
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  background: var(--color-bg, #212332);
  color: var(--color-text, #fff);
}

.post-edit-fish-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #64748b;
}

/* Fish picker modal spacing/layout */
#post-edit-fish-modal .modal__dialog {
  max-width: 860px;
  width: min(94vw, 860px);
  padding: 0.9rem;
}

#post-edit-fish-modal .modal__header {
  margin-bottom: 0.55rem;
}

#post-edit-fish-modal #post-edit-fish-search {
  width: 100%;
  min-width: 0;
  margin-bottom: 0.6rem;
}

#post-edit-fish-modal .user-profile-modal__posts {
  max-height: min(62vh, 540px) !important;
  padding-right: 0.15rem;
}

#post-edit-fish-modal .bite-fish-list {
  border-radius: 10px;
}

#post-edit-fish-modal .bite-fish-item {
  padding: 0.6rem 0.65rem;
  align-items: flex-start;
}

#post-edit-fish-modal .bite-fish-item__body {
  width: 100%;
}

#post-edit-fish-modal .post-edit-fish-checkbox {
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
}

#post-edit-fish-modal .post-edit-fish-fields {
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0.1rem;
  max-width: 760px;
}

#post-edit-fish-modal .post-edit-fish-input-group {
  grid-template-columns: minmax(120px, 1fr) 64px;
  gap: 0.35rem;
  min-width: 0;
  align-items: stretch;
}

#post-edit-fish-modal .post-edit-fish-fields input,
#post-edit-fish-modal .post-edit-fish-unit {
  height: 36px;
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
  box-sizing: border-box;
}

#post-edit-fish-modal .post-edit-fish-fields input {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

#post-edit-fish-modal .post-edit-fish-unit {
  min-width: 64px;
  text-align: center;
}

#post-edit-fish-modal .bite-fish-item:has(.post-edit-fish-fields) {
  padding-bottom: 0.7rem;
}

#post-edit-fish-modal .modal__footer {
  margin-top: 0.7rem;
}

@media (max-width: 760px) {
  #post-edit-fish-modal .modal__dialog {
    width: min(96vw, 860px);
    padding: 0.75rem;
  }

  #post-edit-fish-modal .post-edit-fish-fields {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.post-edit-photo-remove {
  align-self: flex-start;
}

.post-preview__description-input {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-subtle, #e2e5ec);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}

.post-preview__description {
  border: 1px solid var(--color-border-subtle, #dbe3ef);
  border-radius: 10px;
  background: var(--color-bg, #f8fafc);
  padding: 0.65rem 0.75rem;
  min-height: 100px;
  white-space: pre-wrap;
}

.post-preview__photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.55rem;
}

.post-preview__photo {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
}

.post-preview__photos--empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  padding: 0.6rem 0.75rem;
  font-size: 0.84rem;
}

.modal__dialog--wide {
  max-width: 1200px;
  width: min(96vw, 1200px);
}

.modal__dialog--post-preview {
  max-width: min(100vw, 2560px);
  width: min(100vw - 1rem, 2560px);
}

/* Post edit: address picker modal fits viewport */
#post-edit-address-modal .modal__dialog {
  height: min(90vh, 860px);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#post-edit-address-modal .map-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#post-edit-address-modal #post-edit-address-map.map {
  height: 100%;
  min-height: 0;
}

#post-edit-address-modal .map-hint {
  margin: 0;
}

#zone-inaccuracy-edit-modal .modal__dialog {
  height: min(90vh, 860px);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#zone-inaccuracy-edit-modal .map-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#zone-inaccuracy-edit-modal #zone-inaccuracy-edit-map.map {
  height: 100%;
  min-height: 0;
}

#zone-inaccuracy-edit-modal .map-hint {
  margin: 0;
  flex-shrink: 0;
}

.post-preview-layout {
  display: block;
}

.post-preview-comments-col {
  min-width: 0;
  min-height: 0;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border-subtle, #dbe3ef);
}

.post-preview-comments-col .user-profile-modal__posts-title {
  margin-bottom: 0.55rem;
}

#post-preview-modal .post-preview-comments-col .user-profile-modal__posts {
  /* Чтобы таблица комментариев помещалась без внутреннего скролла */
  max-height: min(75vh, 900px);
}

.post-edit-card {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1rem 1.15rem;
}

#post-preview-modal .post-preview-comments-col .moderation-table-wrap {
  /* Скролл пусть делает сама модалка, а не wrapper таблицы */
  overflow: visible;
  max-width: 100%;
}

#post-preview-modal .moderation-table {
  width: 100%;
  min-width: 0;
}

#post-preview-modal .moderation-table--post-comments {
  table-layout: fixed;
  width: 100%;
  /* Таблица должна подстраиваться под ширину модалки, без горизонтального скролла */
  min-width: 0;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-id {
  width: 10%;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-author {
  width: 7%;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-text {
  width: 18%;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-likes {
  width: 11%;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-status {
  width: 11%;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-reports {
  width: 9%;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__col-actions {
  width: 34%;
}

#post-preview-modal .moderation-table--post-comments th {
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 0.55rem 0.35rem;
}

#post-preview-modal .moderation-table--post-comments th:last-child,
#post-preview-modal .moderation-table--post-comments td.moderation-table__actions {
  text-align: right;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__actions-inner {
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.4rem;
  justify-content: flex-end;
  width: 100%;
}

#post-preview-modal .moderation-table--post-comments td:nth-child(1) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#post-preview-modal .moderation-table--post-comments td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#post-preview-modal .moderation-table--post-comments td:nth-child(4) {
  white-space: nowrap;
}

#post-preview-modal .moderation-table--post-comments td:nth-child(5) {
  white-space: nowrap;
  vertical-align: middle !important;
  text-align: center;
}

#post-preview-modal .moderation-table--post-comments td:nth-child(5) .post-status {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  margin: 0 auto;
}

#post-preview-modal .moderation-table--post-comments th:nth-child(5) {
  vertical-align: middle !important;
  text-align: center;
}

#post-preview-modal .moderation-table--post-comments .moderation-table__actions .btn--sm {
  padding: 0.24rem 0.42rem;
  font-size: 0.72rem;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}

#post-preview-modal .post-preview-comments-col {
  margin-bottom: 0.35rem;
}

#post-preview-modal .modal__footer {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border-subtle, #dbe3ef);
  justify-content: flex-end;
  width: 100%;
}

.user-profile-modal__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.user-profile-modal__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.user-profile-modal__name {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.user-profile-modal__posts-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.user-profile-modal__posts {
  max-height: 360px;
  overflow: auto;
}

.user-profile-modal__table {
  width: 100%;
  min-width: 0;
}

.user-profile-relations {
  margin-bottom: 0.9rem;
}

.user-profile-relations__tabs {
  display: inline-flex;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  padding: 0.24rem;
  border: 1px solid var(--color-border-subtle, #dbe3ef);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.08);
}

#user-profile-modal .user-profile-relations__tabs .btn {
  margin: 0;
  padding: 0.4rem 0.82rem;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--color-text-muted, #cbd5e1);
  background: transparent;
}

#user-profile-modal .user-profile-relations__tabs .btn.is-active {
  border-color: rgba(147, 197, 253, 0.95);
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #4f46e5);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 6px 14px rgba(37, 99, 235, 0.25);
}

#user-profile-modal .user-profile-relations__tabs .btn:not(.is-active):hover {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.2);
}

.user-profile-relations__table {
  max-height: 220px;
}

#user-profile-modal .moderation-table__actions .btn {
  margin: 0.2rem 0.45rem 0.2rem 0;
}

#user-profile-modal .modal__footer {
  padding-top: 0.65rem;
  margin-top: 0.65rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  padding-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

#user-profile-modal .modal__footer .btn {
  padding: 0.56rem 1.05rem;
  min-width: 128px;
}

.role-form {
  display: grid;
  grid-template-columns: 220px minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 0.6rem;
}

.role-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.83rem;
}

.role-form input {
  border: 1px solid #d6deeb;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.role-permissions {
  grid-column: 1 / -1;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  margin: 0;
  padding: 0.68rem;
}

.role-permissions__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.45rem 0.8rem;
}

.role-permission {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.52);
}

.modal__dialog {
  position: relative;
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  margin: 1rem auto;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 1rem;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.modal__close {
  width: 32px;
  height: 32px;
  border: 1px solid #d6deeb;
  border-radius: 8px;
  background: #fff;
}

.modal__footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.leaflet-div-icon.map-pin {
  background: transparent;
  border: none;
}

.map-pin__dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.map-pin--forbidden .map-pin__dot {
  background: #f44336;
}

.map-pin--border .map-pin__dot {
  background: #9c27b0;
}

/* --- Прогноз клёва --- */
.bite-intro {
  margin-bottom: 1rem;
}

.bite-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.bite-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: calc(100vh - 220px);
  min-width: 0;
}

.bite-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bite-search {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.bite-fish-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.bite-fish-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  transition: background 0.12s ease;
}

.bite-fish-item:hover {
  background: #f8fafc;
}

.bite-fish-item--active {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.bite-fish-item__img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #f1f5f9;
  flex-shrink: 0;
}

.bite-fish-item__body {
  min-width: 0;
  flex: 1;
}

#bite-fish-list .bite-fish-item__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.bite-fish-item__text {
  min-width: 0;
  flex: 1;
}

.bite-fish-item__name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}

#bite-fish-list .bite-fish-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bite-fish-item__meta {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.3;
}

#bite-fish-list .bite-fish-item__meta {
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bite-fish-item__badges {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  padding-top: 0.05rem;
}

.bite-fish-item__badge {
  display: inline-block;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: #dbeafe;
  color: #1d4ed8;
  white-space: nowrap;
}

.bite-fish-item__badge--app {
  background: #ecfdf5;
  color: #047857;
}

.bite-editor {
  padding: 1rem;
}

.bite-editor-empty {
  padding: 2rem 1rem;
  text-align: center;
}

.bite-editor-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.bite-editor-hero {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.bite-editor-title {
  margin: 0;
  font-size: 1.25rem;
}

.bite-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 0 0 1rem;
  padding: 0.75rem;
}

.bite-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.app-content-textarea {
  width: 100%;
  min-height: 120px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  resize: vertical;
}

.app-content-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.bite-seed-status {
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.bite-grid {
  display: grid;
  gap: 0.65rem;
}

.bite-grid--4 {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.bite-fieldset-sub {
  margin-bottom: 0.85rem;
}

.bite-fieldset-subtitle {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.bite-grid label,
.bite-fieldset label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.bite-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.75rem;
}

.bite-checks--multi {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 0;
}

.bite-range-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.bite-season-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.55rem 0.75rem;
}

.bite-season-grid label span {
  font-size: 0.78rem;
  color: #475569;
}

.bite-spawn-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}

.bite-note {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.bite-encyclopedia-photos-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.bite-encyclopedia-photos-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2e2e2e;
}

.bite-encyclopedia-photos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bite-encyclopedia-photo-item {
  position: relative;
  width: 88px;
}

.bite-encyclopedia-photo-item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
  display: block;
}

.bite-encyclopedia-photo-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 100px;
  background: rgba(17, 17, 23, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.bite-encyclopedia-upload input[type="file"] {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

.pushes-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 1rem;
  align-items: start;
}

.pushes-compose-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.onboarding-image-preview-wrap {
  margin-bottom: 0.75rem;
}

.onboarding-image-preview {
  width: 100%;
  max-height: 188px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #e0e2e7);
}

.onboarding-image-placeholder {
  padding: 1.5rem;
  border: 1px dashed #d5d8df;
  border-radius: 8px;
  text-align: center;
  font-size: 0.85rem;
}

.pushes-compose-card input[type="text"],
.pushes-compose-card input[type="datetime-local"] {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.push-status-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #eef2ff;
  color: #334155;
}

.push-status-badge--sent { background: #e8f7ee; color: #166534; }
.push-status-badge--scheduled { background: #fff7e6; color: #9a6700; }
.push-status-badge--failed { background: #fdecec; color: #b42318; }
.push-status-badge--cancelled { background: #f2f3f7; color: #6c778b; }

@media (max-width: 1100px) {
  .pushes-layout {
    grid-template-columns: 1fr;
  }
}

.bite-editor-actions {
  margin-top: 0.5rem;
}

@media (max-width: 1200px) {
  .zones-layout {
    grid-template-columns: 1fr;
  }

  #view-zones .map-wrap,
  #view-zones .zones-side {
    height: auto;
    max-height: none;
  }

  .fish-points-layout .map-wrap,
  .fish-points-layout .zones-side {
    height: auto;
    max-height: none;
  }

  .bite-layout {
    grid-template-columns: 1fr;
  }

  .bite-side {
    max-height: 280px;
  }

  .bite-grid--4 {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 800px) {
  .post-edit-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .post-preview--post > p:nth-of-type(-n + 8) {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .zones-side-grid,
  .role-permissions__list,
  .role-form,
  .user-form {
    grid-template-columns: 1fr;
  }

  .post-edit-status-actions {
    flex-wrap: wrap;
  }

  .post-edit-status-actions #btn-post-edit-save {
    width: 100%;
    min-width: 0;
  }

  .role-table,
  .user-table,
  .moderation-table {
    min-width: 0;
  }

  .map,
  .map--viewer {
    min-height: calc(100vh - 170px);
    height: calc(100vh - 170px);
  }
}

/* --- Вход --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #eef2ff 0%, #f5f7fb 45%, #ecfdf5 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.75rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.login-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.login-card__title {
  margin: 0;
  font-size: 1.35rem;
}

.login-card__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.login-card__field input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  font: inherit;
}

.login-card__error {
  margin: 0;
  min-height: 1.1rem;
  color: #b91c1c;
  font-size: 0.85rem;
}

.login-card__submit {
  width: 100%;
  margin-top: 0.25rem;
}

.login-card__hint {
  margin: 0;
  text-align: center;
}

/* --- Navbar user --- */
.navbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 1rem;
}

.navbar-user__info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.navbar-user__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.navbar-user__role {
  font-size: 0.75rem;
}

/* --- Обзор: дашборд (тёмная тема) --- */
.dashboard-view .main__header {
  margin-bottom: 1.25rem;
}

.dashboard-meta {
  margin: 0.35rem 0 0;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
}

.dashboard-meta__sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.dashboard-hero {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, rgba(38, 151, 255, 0.14), rgba(42, 45, 62, 0.95));
  border-color: var(--color-border-accent, rgba(38, 151, 255, 0.15));
}

.dashboard-hero__label {
  font-size: 0.78rem;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.dashboard-hero__value {
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 700;
  color: var(--color-primary, #2697ff);
}

.dashboard-hero__hint {
  margin: 0;
}

.dashboard-section__title {
  margin: 1.35rem 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-section__title:first-of-type {
  margin-top: 0.25rem;
}

.dashboard-summary-card {
  margin-bottom: 0.25rem;
  padding: 0.85rem;
}

.dashboard-kv-grid {
  display: grid;
  gap: 0.65rem;
}

.dashboard-kv-grid--summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-kv-grid--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-kv-grid--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-kv-grid--compact {
  margin-bottom: 0;
}

.dashboard-kv {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-card, 10px);
  background: rgba(255, 255, 255, 0.03);
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-kv__value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary, #2697ff);
  line-height: 1.15;
  word-break: break-word;
}

.dashboard-kv--text .dashboard-kv__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent-sky, #a4cdff);
  text-transform: lowercase;
}

.dashboard-kv__label {
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
  line-height: 1.3;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

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

.dashboard-panel--bars {
  min-height: 220px;
}

.dashboard-panel--wide {
  grid-column: 1 / -1;
}

.dashboard-panel .content-module__title {
  margin-bottom: 0.85rem;
}

.dashboard-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 140px;
}

.dashboard-empty {
  margin: 0;
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.dashboard-subtitle {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-bar {
  display: grid;
  grid-template-columns: minmax(108px, 1.1fr) 1fr auto;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.dashboard-bar:last-child {
  margin-bottom: 0;
}

.dashboard-bar__label {
  font-size: 0.8rem;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
  line-height: 1.25;
}

.dashboard-bar__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dashboard-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2697ff, #6366f1);
  min-width: 0;
  transition: width 0.35s ease;
}

.dashboard-bar__fill--green {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.dashboard-bar__fill--amber {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.dashboard-bar__fill--red {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.dashboard-bar__fill--blue {
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.dashboard-bar__value {
  min-width: 1.75rem;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text, #fff);
  font-variant-numeric: tabular-nums;
}

.dashboard-app-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.1));
}

.dashboard-app-head__value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text, #fff);
  margin-top: 0.15rem;
}

.dashboard-app-status {
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.dashboard-app-status--ok {
  color: var(--color-success, #22c55e);
}

.dashboard-app-status--warn {
  color: var(--color-warning, #f59e0b);
}

.dashboard-app-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.dashboard-flag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
  color: var(--color-text, #fff);
}

.dashboard-flag--off .dashboard-flag__label {
  color: var(--color-text-muted, rgba(255, 255, 255, 0.55));
}

.dashboard-flag__label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.dashboard-flag__status {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.dashboard-flag--on .dashboard-flag__status {
  color: var(--color-success, #22c55e);
}

.dashboard-flag--off .dashboard-flag__status {
  color: var(--color-danger, #ef4444);
}

.dashboard-flag__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dashboard-flag__dot--on {
  background: var(--color-success, #22c55e);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.28),
    0 0 10px rgba(34, 197, 94, 0.55);
}

.dashboard-flag__dot--off {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.dashboard-flag__dot--off-danger {
  background: var(--color-danger, #ef4444);
  box-shadow:
    0 0 0 3px rgba(239, 68, 68, 0.28),
    0 0 10px rgba(239, 68, 68, 0.45);
}

@media (max-width: 1280px) {
  .dashboard-kv-grid--summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .dashboard-kv-grid--summary,
  .dashboard-kv-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-app-head,
  .dashboard-app-columns {
    grid-template-columns: 1fr;
  }

  .dashboard-bar {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .dashboard-bar__value {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .dashboard-kv-grid--summary,
  .dashboard-kv-grid--6,
  .dashboard-kv-grid--4 {
    grid-template-columns: 1fr;
  }
}

.api-status-bar {
  margin: 0 0 1rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.api-status-bar--ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.api-status-bar--warn {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.api-status-bar--err {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.chats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 1rem;
  align-items: start;
}

.chats-layout__main {
  min-height: 0;
}

/* Чаты: без скролла страницы, скролл только внутри таблицы и ленты */
body:has(#view-chats.view--active) {
  overflow: hidden;
}

.wrapper:has(#view-chats.view--active) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.wrapper:has(#view-chats.view--active) .main {
  min-height: 0;
  overflow: hidden;
}

.content:has(#view-chats.view--active) {
  overflow: hidden;
  flex: 1 1 0;
  min-height: 0;
}

#view-chats.view--active {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

#view-chats.view--active .main__header {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

#view-chats.view--active > .moderation-card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-chats.view--active > .moderation-card > p.muted {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

#view-chats .chats-layout {
  flex: 1 1 0;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
}

#view-chats .chats-layout__main {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#view-chats .chats-layout__main .moderation-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

#view-chats .chats-side-panel {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  top: auto;
}

#view-chats #chat-messages-panel-hint {
  flex-shrink: 0;
  margin-bottom: 0;
}

#view-chats .chat-feed {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.chats-side-panel {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - var(--header-height) - 2 * var(--space-base) - 5rem);
  overflow: hidden;
}

.chats-side-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}

.chats-side-panel__header .content-module__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.chat-live-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
}

.chat-feed-toolbar {
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.chat-feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chat-feed-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  color: inherit;
}

.chat-feed-filter.is-active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-weight: 600;
}

.chat-feed-filter__count {
  display: inline-flex;
  min-width: 1.15rem;
  justify-content: center;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.72rem;
  font-weight: 600;
}

.chat-feed-filter__count--pending {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.chat-compose-form {
  flex-shrink: 0;
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.chat-compose-form__row {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) 2.75rem;
  grid-template-rows: auto 2.75rem;
  column-gap: 0.5rem;
  row-gap: 0.3rem;
  align-items: center;
}

.chat-compose-form__label {
  display: block;
  font-size: 0.7rem;
  line-height: 1;
  color: #64748b;
  margin: 0;
}

.chat-compose-form__label--author {
  grid-column: 1;
  grid-row: 1;
}

.chat-compose-form__label--text {
  grid-column: 2;
  grid-row: 1;
}

.chat-compose-form__label-spacer {
  grid-column: 3;
  grid-row: 1;
}

.chat-compose-form__author-input,
.chat-compose-form__text-input {
  width: 100%;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  line-height: 1.35;
  box-sizing: border-box;
  resize: none;
}

.chat-compose-form__author-input {
  grid-column: 1;
  grid-row: 2;
}

.chat-compose-form__text-input {
  grid-column: 2;
  grid-row: 2;
}

.chat-compose-form__send {
  grid-column: 3;
  grid-row: 2;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  border-radius: 8px;
}

.chat-feed {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 0.55rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-feed__empty {
  margin: auto;
  text-align: center;
  padding: 1rem;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  align-self: flex-start;
}

.chat-msg--out {
  align-self: flex-end;
}

.chat-msg__bubble {
  padding: 0.45rem 0.6rem;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.chat-msg--out .chat-msg__bubble {
  border-radius: 12px 12px 4px 12px;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.chat-msg--pending .chat-msg__bubble {
  border-color: #fbbf24;
  background: rgba(255, 251, 235, 0.95);
}

.chat-msg--rejected .chat-msg__bubble {
  border-color: #fca5a5;
  background: rgba(254, 242, 242, 0.9);
  opacity: 0.88;
}

.chat-msg__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  color: #64748b;
}

.chat-msg__author {
  font-weight: 600;
  color: #334155;
}

.chat-msg__author--link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-msg__author--link:hover {
  color: #2563eb;
}

.chat-author-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-author-link:hover {
  color: #1d4ed8;
}

.chat-msg__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.chat-msg__bubble:hover .chat-msg__actions,
.chat-msg--pending .chat-msg__actions,
.chat-msg__bubble:focus-within .chat-msg__actions {
  opacity: 1;
  pointer-events: auto;
}

.chat-msg__actions .btn--sm {
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  min-height: 1.6rem;
}

.moderation-table tr.is-selected {
  cursor: pointer;
}

.moderation-table tr.is-selected td {
  font-weight: 500;
}

/* История модерации чата */
.moderation-table-wrap--chat-history {
  overflow: auto;
}

.moderation-table--chat-history {
  table-layout: fixed;
  width: 100%;
  min-width: 880px;
}

.moderation-table--chat-history th:nth-child(1) {
  width: 7.5rem;
}

.moderation-table--chat-history th:nth-child(2) {
  width: 11rem;
}

.moderation-table--chat-history th:nth-child(3) {
  width: 8rem;
}

.moderation-table--chat-history th:nth-child(5) {
  width: 9.5rem;
}

.moderation-table--chat-history th:nth-child(6) {
  width: 7rem;
}

.moderation-table--chat-history th.moderation-table__th-actions {
  width: 12.5rem;
}

.chat-mod-history-empty {
  text-align: center;
  padding: 1.25rem !important;
}

.chat-mod-history__when {
  vertical-align: top;
}

.chat-mod-history__when-main {
  display: block;
  font-weight: 500;
  white-space: nowrap;
}

.chat-mod-history__when-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  opacity: 0.75;
  word-break: break-all;
}

.chat-mod-history__chat-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.chat-mod-history__chat-link:hover {
  color: #1d4ed8;
}

.chat-mod-history__text {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
}

.chat-mod-history__badges-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.chat-mod-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chat-mod-badge--approved {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.chat-mod-badge--rejected {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.chat-mod-badge--deleted {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.chat-mod-badge--unknown {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.chat-mod-badge--source {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
  font-weight: 500;
}

.chat-mod-history__actions {
  justify-content: flex-end;
}

#chat-message-preview-modal .modal__footer.chat-msg-preview-footer {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border-subtle, #dbe3ef);
}

.chat-msg-preview-footer__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.chat-msg-preview-footer__moderation {
  margin-left: auto;
}

@media (max-width: 640px) {
  #chat-message-preview-modal .modal__footer.chat-msg-preview-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-msg-preview-footer__moderation {
    margin-left: 0;
  }

  .chat-msg-preview-footer__group .btn,
  #chat-message-preview-modal .chat-msg-preview-footer > .btn {
    width: 100%;
  }
}

.chat-mod-history__actions .btn--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  min-height: 1.75rem;
}

@media (max-width: 960px) {
  .moderation-table--chat-history {
    min-width: 760px;
  }

  .chat-mod-history__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-mod-history__actions .btn--sm {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .chats-layout {
    grid-template-columns: 1fr;
  }

  .chats-side-panel {
    position: static;
    max-height: min(70vh, calc(100vh - var(--header-height) - 2 * var(--space-base) - 4rem));
  }

  #view-chats .chats-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  #view-chats .chats-side-panel {
    max-height: min(70vh, 100%);
  }

  .chat-compose-form__row {
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    grid-template-rows: auto 2.75rem auto 2.75rem;
  }

  .chat-compose-form__label--author {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .chat-compose-form__label--text {
    grid-column: 1;
    grid-row: 3;
  }

  .chat-compose-form__label-spacer {
    display: none;
  }

  .chat-compose-form__author-input {
    grid-column: 1;
    grid-row: 2;
  }

  .chat-compose-form__text-input {
    grid-column: 1;
    grid-row: 4;
  }

  .chat-compose-form__send {
    grid-column: 2;
    grid-row: 4;
    width: 2.75rem;
  }
}

.mail-stats-summary {
  margin-bottom: 16px;
}

.mail-stats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.mail-stats-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted, #6c778b);
}

.mail-stats-filter select {
  min-width: 200px;
}

.mail-status-badge,
.mail-purpose-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.mail-purpose-badge {
  background: #eef2ff;
  color: #3b4fd8;
}

.mail-status-badge--sent {
  background: #e8f7ee;
  color: #166534;
}

.mail-status-badge--failed {
  background: #fdecec;
  color: #b42318;
}

.mail-status-badge--dev {
  background: #fff7e6;
  color: #9a6700;
}

#mail-logs-table th[data-sort] {
  user-select: none;
}
