:root {
  --bg: #0b0d11;
  --surface: #12151c;
  --surface2: #1a1f2a;
  --border: #2a3142;
  --text: #e9edf5;
  --muted: #8b95a8;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.15);
  --danger: #f87171;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

body {
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(45, 212, 191, 0.08), transparent 55%);
}

#app {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

/* Login */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.brand-mark {
  font-size: 1.75rem;
  color: var(--accent);
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.hint.small {
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--surface2);
  padding: 4px;
  border-radius: var(--radius);
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.panel label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.panel input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s;
}

.btn-small {
  width: auto;
  margin-top: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.btn-small.primary {
  width: auto;
  margin-top: 0;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}

.tag-reservoir-main {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.12);
}

.tag-reservoir-res {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.12);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  width: auto;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #042f2e;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  width: auto;
  margin-top: auto;
}

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

.err {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.err-inline {
  color: var(--danger);
}

.calculator-table {
  min-width: 280px;
}

.calc-details summary {
  user-select: none;
}

.calc-details summary::-webkit-details-marker {
  color: var(--muted);
}

.tg-block {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.tg-block .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

/* App shell */
#screen-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 880px) {
  #screen-app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sb-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sb-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sb-user .name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}

.badge {
  font-size: 0.75rem;
}

.badge.admin {
  color: var(--accent);
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sb-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.sb-nav a:hover {
  background: var(--surface2);
  color: var(--text);
}

.sb-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.sb-nav a.sb-nav-link-chat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.sb-nav-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.42);
  color: #e11d48;
  flex-shrink: 0;
}

.sb-nav-chat-badge:empty,
.sb-nav-chat-badge[hidden] {
  display: none !important;
}

.main {
  position: relative;
  padding: 1.5rem 2rem 3rem;
  /* Ширина должна адаптироваться к экрану */
  width: 100%;
  max-width: none;
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-width: 360px;
}

.page h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.page .lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Profiles UI */
.profiles-top {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 880px) {
  .profiles-top {
    grid-template-columns: 1fr;
  }
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
}

.profile-label {
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 0.35rem;
}

.profile-input {
  font: inherit;
}

.profile-avatar-cell {
  display: flex;
  flex-direction: column;
}

.pf-avatar-img {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface2);
  object-fit: cover;
  margin-bottom: 0.5rem;
}

.profile-plazas {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 0.5rem;
  align-items: start;
}

.profile-inline-field {
  display: block;
}

.alliance-member-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.alliance-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}

.alliance-member-meta {
  min-width: 0;
}

.alliance-member-nick {
  font-weight: 600;
  line-height: 1.15;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.avatar-picker-modal .avatar-modal-step {
  margin-top: 0.75rem;
}

.avatar-modal-step.hidden {
  display: none !important;
}

.avatar-preset-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.avatar-preset-tile {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 12px;
  padding: 0.5rem;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.avatar-preset-tile:active {
  transform: scale(0.98);
}

.avatar-preset-img {
  width: 92px;
  height: 92px;
  display: block;
  border-radius: 18px;
}

.stat {
  padding: 1rem;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.stat .v {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat .k {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

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

.chat-tabs button {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
}

.chat-tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.chat-compose {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat-compose textarea#chat-input {
  margin: 0;
  min-height: 48px;
  font-family: inherit;
  flex: 1;
}

.chat-compose-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

#chat-emoji-toggle {
  font-size: 1.05rem;
  line-height: 1;
  padding-inline: 0.7rem;
}

.chat-emoji-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 1200;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.chat-emoji-picker {
  width: min(340px, 88vw);
  height: 380px;
}

.msg-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--bg);
  margin-bottom: 0.75rem;
}

.msg {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.msg:last-child {
  border-bottom: none;
}

.msg .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.chat-meta-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.chat-meta-main {
  flex: 1;
  min-width: 0;
}

.chat-nick-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-nick {
  text-decoration: underline dotted;
  color: var(--text);
}

.chat-id {
  color: var(--text-muted, var(--muted));
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg);
}

.chat-avatar-placeholder {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.chat-mention-menu {
  position: fixed;
  z-index: 1000;
  background: var(--bg-card, var(--surface2));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-tab-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--text);
}

.prose {
  color: var(--muted);
  max-width: 65ch;
}

.feedback-item {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.65rem;
}

.feedback-item:last-child {
  margin-bottom: 0;
}

.feedback-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.feedback-item-type {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  color: var(--text);
  background: rgba(45, 212, 191, 0.1);
}

.feedback-item-text {
  white-space: pre-wrap;
}

.prose h3 {
  color: var(--text);
  margin-top: 1.25rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.label-inline {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.5rem;
}

.reservoir-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.reservoir-col--left {
  flex: 1 1 520px;
  min-width: 320px;
}

.reservoir-col--right {
  flex: 1 1 320px;
  min-width: 280px;
}

.reservoir-pool-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.85rem 0;
}

.reservoir-pool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.reservoir-pool-item:last-child {
  border-bottom: none;
}

.reservoir-stage-block {
  margin-top: 0.85rem;
}

.reservoir-stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.reservoir-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  background: var(--surface2);
  margin-bottom: 0.75rem;
}

.reservoir-group-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.reservoir-group-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

.reservoir-add-row select {
  margin-top: 0.35rem;
}

.reservoir-pick {
  width: 100%;
}

.reservoir-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 0.75rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.reservoir-toolbar {
  margin-bottom: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.reservoir-toolbar .btn.primary {
  width: auto;
  margin-top: 0;
}

.reservoir-member-row.hidden {
  display: none !important;
}

.tag-reservoir-main,
.tag-reservoir-res {
  white-space: nowrap;
}

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

.territory-map-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #f6f8fc;
}

.territory-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 72vh;
}

.territory-zone {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.territory-zone:hover {
  opacity: 0.8;
}

.territory-zone-label {
  font-size: 9px;
  fill: #1f2937;
  stroke: #ffffff;
  stroke-width: 0.9px;
  paint-order: stroke;
  pointer-events: none;
  user-select: none;
}

.territory-side {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  padding: 0.75rem;
}

.territory-side input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  margin: 0.35rem 0 0.75rem;
}

.territory-alliance-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.territory-alliance-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.01);
}

.territory-alliance-row--active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35) inset;
}

.territory-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.35);
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.territory-alliance-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.territory-toolbar {
  margin-bottom: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@media (max-width: 1020px) {
  .territory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main {
    padding: 1rem 0.85rem 1.5rem;
  }

  .sidebar {
    padding: 0.8rem;
    gap: 0.65rem;
  }

  .sb-nav {
    gap: 0.35rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .sb-nav a {
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 0.85rem;
    padding: 0.42rem 0.62rem;
  }

  .card {
    padding: 0.9rem;
  }

  .toast {
    right: 0.6rem;
    top: 0.6rem;
    max-width: calc(100vw - 1.2rem);
  }

  .profile-edit-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .profile-label {
    padding-top: 0;
  }

  .profile-plazas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-tabs {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

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

  .chat-compose-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .msg-list {
    max-height: 52vh;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #alliance-name-input,
  #alliance-new-name,
  #news-title,
  #new-profile-nick {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Союз: мобильный карточный режим для таблиц */
  #alliance-content .alliance-table {
    display: block;
    overflow: visible;
    border-collapse: separate;
  }

  #alliance-content .alliance-table thead {
    display: none;
  }

  #alliance-content .alliance-table tbody,
  #alliance-content .alliance-table tr,
  #alliance-content .alliance-table td {
    display: block;
    width: 100%;
  }

  #alliance-content .alliance-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.55rem;
  }

  #alliance-content .alliance-table td {
    border-bottom: none;
    padding: 0.32rem 0;
    text-align: left !important;
  }

  #alliance-content .alliance-table td::before {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  #alliance-content .alliance-requests-table td:nth-child(1)::before {
    content: "Заявка";
  }

  #alliance-content .alliance-requests-table td:nth-child(2)::before {
    content: "Статус";
  }

  #alliance-content .alliance-requests-table td:nth-child(3)::before {
    content: "Действия";
  }

  #alliance-content .alliance-members-table td:nth-child(1)::before {
    content: "Ник";
  }

  #alliance-content .alliance-members-table td:nth-child(2)::before {
    content: "Роль";
  }

  #alliance-content .alliance-members-table td:nth-child(3)::before {
    content: "Тип";
  }

  #alliance-content .alliance-members-table td:nth-child(4)::before {
    content: "Изменен";
  }

  #alliance-content .alliance-members-table td:nth-child(5)::before {
    content: "Действия";
  }

  #alliance-content .alliance-public-table td:nth-child(1)::before {
    content: "Союз";
  }

  #alliance-content .alliance-public-table td:nth-child(2)::before {
    content: "Штат";
  }

  #alliance-content .alliance-public-table td:nth-child(3)::before {
    content: "Действие";
  }

  #alliance-content .alliance-member-actions {
    width: 100%;
  }

  #alliance-content [data-accept],
  #alliance-content [data-decline],
  #alliance-content [data-join-alliance] {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .main {
    padding: 0.75rem 0.6rem 1.2rem;
  }

  .page h2 {
    font-size: 1.12rem;
  }

  .page .lead {
    font-size: 0.86rem;
    margin-bottom: 1rem;
  }

  .card {
    padding: 0.75rem;
    border-radius: 10px;
  }

  .row {
    gap: 0.4rem;
    margin-bottom: 0.55rem;
  }

  .btn {
    padding: 0.56rem 0.8rem;
    font-size: 0.86rem;
  }

  .chat-tabs button {
    font-size: 0.8rem;
    padding: 0.34rem 0.62rem;
  }

  .chat-compose textarea#chat-input {
    min-height: 42px;
  }

  .profile-plazas {
    grid-template-columns: 1fr;
  }

  #feedback-type,
  #portal-admin-user-id,
  #alliance-new-staff,
  #alliance-staff-filter {
    width: 100% !important;
    max-width: 100% !important;
  }
}
