:root {
  --bg: #f5f5f5;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #fff;
  --soft: #eeeeef;
  --soft-2: #e6e6e8;
  --text: #222224;
  --muted: #8f8f94;
  --line: rgba(28, 28, 30, 0.09);
  --brand: #111;
  --blue: #1d9bf0;
  --green: #23c965;
  --pink: #ff2d7a;
  --danger: #e74055;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.08);
  --blur: blur(20px);
  --radius: 30px;
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 52% 0%, rgba(255,255,255,0.9), transparent 26rem), var(--bg);
  color: var(--text);
  overflow-y: scroll;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  font-size: 16px;
}

button {
  border: 0;
  cursor: pointer;
  background: transparent;
  color: inherit;
}

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

.material-symbols-rounded,
.mi {
  font-family: "Material Symbols Rounded";
  font-weight: 500;
  font-style: normal;
  font-size: 26px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 520, "GRAD" -12, "opsz" 24;
}

.app-shell {
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 760px) minmax(180px, 280px);
  gap: 28px;
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0 40px;
}

.sidebar,
.rightbar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 80px);
  align-self: start;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 36px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.version-pill {
  color: #b4b4b8;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 999px;
  transition: 0.2s ease;
}

.version-pill:hover {
  color: var(--blue);
  background: rgba(29, 155, 240, 0.08);
}

.nav-list {
  display: grid;
  gap: 12px;
}

.nav-item {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border-radius: 18px;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-item:hover {
  transform: translateX(2px);
  color: var(--text);
}

.nav-item.active {
  color: var(--text);
  background: var(--panel-solid);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.025);
  font-weight: 700;
}

.nav-item .event-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #c8fff0, #d8d4ff 55%, #fff 70%);
  box-shadow: 0 8px 20px rgba(29, 155, 240, 0.16);
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  gap: 22px;
  padding: 0 0 20px;
}

.club-link {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #7d7d82;
  font-weight: 600;
  padding-left: 22px;
}

.logout-btn,
.soft-btn,
.black-btn,
.ghost-btn,
.danger-btn {
  min-height: 48px;
  border-radius: 18px;
  padding: 0 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.logout-btn,
.soft-btn {
  background: var(--panel-solid);
}

.black-btn {
  background: var(--brand);
  color: #fff;
}

.ghost-btn {
  background: var(--soft);
}

.danger-btn {
  background: rgba(231, 64, 85, 0.1);
  color: var(--danger);
}

.black-btn:disabled,
.soft-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.logout-btn:hover,
.soft-btn:hover,
.black-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.rightbar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.9;
  padding-bottom: 42px;
}

.main {
  min-width: 0;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 26px;
  min-height: 52px;
}

.page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}

.back-btn,
.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-solid);
  color: #777;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.04);
}

.tabs,
.sort-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  min-height: 58px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: var(--blur);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.04);
  margin-bottom: 18px;
}

.tabs button,
.sort-bar button {
  border-radius: 999px;
  font-weight: 600;
  color: #7e7e84;
}

.tabs button.active,
.sort-bar button.active {
  background: var(--soft);
  color: var(--text);
}

.card,
.composer,
.profile-head,
.panel {
  background: var(--panel-solid);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

.composer {
  padding: 24px 28px;
  margin: 0 0 20px;
}

.composer-top {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f0f0f1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: #31b449;
  font-weight: 600;
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.online::after,
.profile-avatar.online::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--green);
}

.editor {
  min-height: 76px;
  padding: 2px 0;
  outline: none;
  color: var(--text);
  line-height: 1.45;
  font-weight: 500;
}

.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-left: 58px;
}

.tool-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #888;
}

.post-card {
  padding: 28px 30px 22px;
  margin-bottom: 20px;
}

.post-head,
.comment-head,
.notification-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author {
  font-weight: 700;
  color: #18aee5;
}

.role-icon {
  color: var(--blue);
  font-size: 20px;
  vertical-align: middle;
}

.time,
.muted {
  color: var(--muted);
  font-weight: 500;
}

.post-menu {
  margin-left: auto;
  color: #818187;
}

.post-body {
  margin: 10px 0 18px 54px;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-body a,
.post-body .mention,
.tag-link {
  color: var(--blue);
}

.post-media-placeholder,
.poll-box {
  margin: 14px 0 10px 54px;
  border-radius: 18px;
  background: #f3f3f4;
  border: 1px solid var(--line);
}

.poll-box {
  padding: 20px;
}

.poll-option {
  height: 52px;
  border-radius: 12px;
  background: #eeeeef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 500;
  margin-top: 10px;
}

.poll-option.winner {
  background: #111;
  color: #fff;
}

.post-actions {
  margin-left: 54px;
  display: flex;
  align-items: center;
  gap: 26px;
  color: #85858a;
  font-weight: 500;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8a8a90;
}

.action.active {
  color: var(--pink);
}

.action.humor.active {
  color: #28b956;
}

.views {
  margin-left: auto;
}

.floating-create {
  position: fixed;
  right: max(28px, calc((100vw - 1360px) / 2 + 24px));
  bottom: 34px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 16px 44px rgba(0,0,0,0.16), 0 0 0 1px rgba(255,255,255,0.8) inset;
  display: grid;
  place-items: center;
  z-index: 10;
}

.floating-create .mi {
  font-size: 36px;
  color: #111;
}

.search-input {
  min-height: 62px;
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  padding: 0 22px 0 58px;
  font-weight: 500;
  color: var(--text);
}

.search-wrap {
  position: relative;
  margin-bottom: 24px;
}

.search-wrap .mi {
  position: absolute;
  top: 18px;
  left: 22px;
  color: #8b8b90;
}

.panel {
  padding: 26px 28px;
  margin-bottom: 22px;
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 700;
}

.clan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.clan-chip,
.tag-row,
.user-row {
  border-radius: 18px;
  background: var(--soft);
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  font-weight: 600;
}

.tag-list,
.user-list,
.notification-list {
  display: grid;
  gap: 10px;
}

.tag-row {
  justify-content: flex-start;
  min-height: 76px;
}

.tag-index {
  width: 38px;
  text-align: center;
  color: #8c8c91;
}

.notification-card {
  padding: 24px 30px;
  min-height: 114px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.notification-card.unread {
  box-shadow: 0 0 0 2px rgba(29,155,240,0.1) inset;
}

.profile-cover {
  height: 210px;
  border-radius: var(--radius);
  background: linear-gradient(0deg, rgba(255,255,255,0.2), rgba(255,255,255,0.7)), var(--profile-color, #ddd);
  overflow: hidden;
  position: relative;
}

.profile-cover::before {
  content: "хаха  рж";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  color: rgba(0,0,0,0.78);
  font-family: "Comic Sans MS", "Segoe Print", cursive;
  transform: rotate(2deg);
}

.profile-info {
  margin-top: -58px;
  padding: 0 38px 26px;
  position: relative;
}

.profile-avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 8px solid #fff;
  background: #e9e9ea;
  display: grid;
  place-items: center;
  font-size: 42px;
  overflow: hidden;
  position: relative;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-actions {
  position: absolute;
  right: 34px;
  top: 78px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-name {
  margin: 24px 0 4px;
  font-size: 32px;
  font-weight: 700;
}

.profile-stats {
  display: flex;
  gap: 22px;
  margin: 22px 0 18px;
  color: #85858b;
  font-weight: 500;
}

.profile-stats strong {
  color: #111;
}

.profile-extra {
  color: var(--muted);
  display: grid;
  gap: 8px;
  font-weight: 500;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 44px 20px 40px;
}

.auth-card {
  width: min(456px, 100%);
}

.auth-card .black-btn {
  width: 100%;
  min-height: 62px;
  border-radius: 23px;
}

.auth-logo {
  text-align: center;
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 60px;
  letter-spacing: 0;
}

.auth-card h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
}

.auth-card p {
  margin: 10px 0 52px;
  color: var(--muted);
  font-weight: 400;
  font-size: 19px;
}

.field {
  display: grid;
  gap: 12px;
  margin-bottom: 21px;
  font-weight: 500;
  font-size: 18px;
}

.input {
  width: 100%;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f7f8;
  padding: 0 20px;
  outline: 0;
  color: var(--text);
  font-weight: 400;
  font-size: 18px;
}

.input::placeholder {
  color: #a8a8ad;
}

.password-wrap {
  position: relative;
  display: block;
}

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

.password-eye {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #8f8f94;
}

.password-eye .mi {
  font-size: 24px;
}

textarea.input {
  padding-top: 16px;
  min-height: 112px;
  resize: vertical;
}

.input:focus {
  border-color: rgba(29,155,240,0.3);
  background: #fff;
}

.auth-foot {
  text-align: center;
  margin-top: 27px;
  color: var(--muted);
  font-weight: 400;
  font-size: 17px;
}

.link {
  color: var(--blue);
  font-weight: 600;
}

.forgot-row {
  text-align: right;
  margin: 13px 0 48px;
  font-size: 17px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: pop 0.18s ease;
}

.modal.small {
  width: min(440px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255,255,255,0.92);
  backdrop-filter: var(--blur);
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.modal-body {
  padding: 22px;
}

.menu-pop {
  position: fixed;
  z-index: 40;
  min-width: 260px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px);
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.14);
}

.menu-pop button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 500;
  text-align: left;
}

.menu-pop button:hover {
  background: rgba(0,0,0,0.05);
}

.menu-pop .danger {
  color: var(--danger);
}

.toast-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.ios-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: min(420px, calc(100% - 30px));
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px);
  box-shadow: 0 16px 44px rgba(0,0,0,0.16);
  font-weight: 500;
}

.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 80;
  width: min(720px, calc(100% - 30px));
  background: rgba(255,255,255,0.94);
  backdrop-filter: var(--blur);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.14);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 500;
}

.cookie-bar .spacer {
  flex: 1;
}

.bottom-nav {
  display: none;
}

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

.stat-tile {
  background: #fff;
  border-radius: 22px;
  padding: 18px;
}

.stat-tile strong {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}

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

.color-palette {
  display: grid;
  grid-template-columns: repeat(7, 38px);
  gap: 10px;
  margin-top: 8px;
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.9), 0 8px 18px rgba(0,0,0,0.12);
}

.swatch.active {
  outline: 3px solid #111;
}

.comment-box {
  padding: 18px 30px;
  border-top: 1px solid var(--line);
}

.comment-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.comment-card.highlight {
  background: rgba(29,155,240,0.1);
  margin-inline: -20px;
  padding-inline: 20px;
  border-radius: 16px;
}

.bottom-comment {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 12px;
  align-items: center;
}

.loader {
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  padding: 22px;
}

@keyframes pop {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 980px) {
  body {
    background: #fff;
  }

  .layout {
    display: block;
    width: 100%;
    padding: calc(env(safe-area-inset-top) + 26px) 0 calc(env(safe-area-inset-bottom) + 104px);
  }

  .sidebar,
  .rightbar {
    display: none;
  }

  .main {
    width: 100%;
  }

  .page-title-row {
    justify-content: center;
    padding: 0 24px;
    margin-bottom: 22px;
  }

  .page-title {
    font-size: 27px;
  }

  .page-title-row .back-btn {
    position: absolute;
    left: 24px;
  }

  .tabs {
    position: sticky;
    top: max(10px, env(safe-area-inset-top));
    z-index: 5;
    margin: 0 24px 18px;
    min-height: 58px;
  }

  .composer {
    display: none;
  }

  .post-card {
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 18px 24px 16px;
  }

  .post-body,
  .post-actions,
  .post-media-placeholder,
  .poll-box {
    margin-left: 0;
  }

  .post-body {
    font-size: 21px;
  }

  .post-actions {
    gap: 22px;
  }

  .bottom-nav {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    z-index: 20;
    min-height: 72px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(26px);
    border-radius: 30px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.12);
    padding: 8px;
  }

  .bottom-nav button {
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    display: grid;
    place-items: center;
    color: #111;
  }

  .bottom-nav button.active {
    background: rgba(29,155,240,0.12);
    color: var(--blue);
  }

  .bottom-nav .mi {
    font-size: 30px;
  }

  .floating-create {
    right: 30px;
    bottom: calc(env(safe-area-inset-bottom) + 112px);
    width: 64px;
    height: 64px;
  }

  .panel {
    margin: 0 24px 22px;
    border-radius: 22px;
    background: #f0f0f5;
  }

  .clan-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-wrap {
    margin: 0 24px 22px;
  }

  .notification-card {
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--line);
  }

  .profile-head {
    border-radius: 0;
    box-shadow: none;
    text-align: center;
  }

  .profile-cover {
    border-radius: 0;
    height: 190px;
  }

  .profile-info {
    padding: 0 24px 24px;
  }

  .profile-avatar {
    margin: 0 auto;
  }

  .profile-actions {
    position: static;
    justify-content: center;
    margin: 20px 0;
  }

  .profile-stats {
    justify-content: center;
  }

  .auth-page {
    align-items: start;
    padding-top: calc(env(safe-area-inset-top) + 100px);
  }

  .auth-logo {
    margin-bottom: 64px;
    font-size: 40px;
  }

  .auth-card h1 {
    text-align: center;
    font-size: 36px;
  }

  .auth-card p {
    text-align: center;
  }

  .input {
    min-height: 78px;
    border: 0;
    background: #f4f4f5;
    border-radius: 16px;
  }

  .black-btn {
    min-height: 78px;
    border-radius: 28px;
    width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 86vh;
    border-radius: 30px 30px 0 0;
  }

  .menu-pop {
    left: 24px !important;
    right: 24px;
    top: auto !important;
    bottom: 112px;
  }

  .cookie-bar {
    display: grid;
    bottom: calc(env(safe-area-inset-bottom) + 102px);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}
