:root {
  --bg: #f5f5f2;
  --panel: #ffffff;
  --ink: #191919;
  --muted: #6f6f68;
  --line: #deded8;
  --accent: #e74869;
  --accent-2: #0e8f7e;
  --shadow: 0 18px 45px rgba(25, 25, 25, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 700;
}

.nav a:hover,
.user-link:hover {
  color: var(--accent);
}

.mobile-menu-button {
  display: none;
}

.nav-more {
  position: relative;
}

.nav-more > button,
.mobile-menu-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  display: none;
  min-width: 180px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.nav-more:hover .nav-menu,
.nav-more:focus-within .nav-menu {
  display: grid;
}

.nav-menu a {
  padding: 10px;
  border-radius: 8px;
}

.nav-menu a:hover {
  background: #f7f7f4;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 18, .45);
}

.drawer-panel {
  position: relative;
  z-index: 1;
  width: min(310px, 86vw);
  height: 100%;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.drawer-nav {
  display: grid;
  gap: 4px;
}

.drawer-nav a {
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.mobile-create-fab {
  position: fixed;
  right: 18px;
  bottom: 92px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 28px rgba(231, 64, 104, .32);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

@media (min-width: 901px) {
  .mobile-create-fab {
    display: none;
  }
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 650px) 300px;
  gap: 32px;
  align-items: start;
}

.feed {
  display: grid;
  gap: 24px;
}

.feed-loader,
.feed-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
}

.feed-loader[hidden],
.feed-end[hidden] {
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #e2e2dc;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.post,
.auth-panel,
.empty,
.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.post {
  overflow: hidden;
}

.post-head,
.mini-profile,
.profile-title,
.stats,
.actions {
  display: flex;
  align-items: center;
}

.post-head {
  gap: 12px;
  padding: 8px 16px;
}

.post-head .avatar {
  width: 42px;
  height: 42px;
}

.post-head-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}

.post-head-name {
  line-height: 1.2;
}

.post-head-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.post-head small,
.mini-profile p,
.profile-info p {
  color: var(--muted);
  margin: 0;
}

.post-location-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  width: fit-content;
  color: #087769;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.post-location-link:hover {
  text-decoration: underline;
}

.post-location-link span {
  position: relative;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px 999px 999px 2px;
  transform: rotate(-45deg);
  opacity: .8;
}

.post-location-link span::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: currentColor;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
}

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

.avatar.big {
  width: 64px;
  height: 64px;
}

.avatar.huge {
  width: 128px;
  height: 128px;
  font-size: 48px;
}

.post-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #ecece8;
}

.post-gallery-contain .post-image {
  height: auto;
  max-height: 680px;
  aspect-ratio: auto;
  object-fit: contain;
}

.post-gallery-contain {
  align-items: center;
  background: #ecece8;
}

.post-body {
  padding: 14px 16px 16px;
}

.actions {
  gap: 10px;
  margin-bottom: 8px;
  justify-content: space-between;
}

.action-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f2ee;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  transition: transform .15s ease, background .15s ease, color .15s ease;
  appearance: none;
}

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

.icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon:hover {
  transform: translateY(-1px);
}

.icon.active {
  background: #ffe4ea;
  color: var(--accent);
}

.post-body p,
.comments p {
  margin: 8px 0;
}

.comment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-like-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-height: 28px;
  padding: 0 4px;
  font-weight: 800;
}

.comment-like-btn.active {
  color: var(--accent);
}

.user-link {
  font-weight: 800;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fbfbf9;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.comment-form input {
  border: 0;
  background: transparent;
  padding-left: 0;
}

.report-form,
.quick-edit-form {
  display: grid;
  gap: 14px;
}

.report-form label,
.quick-edit-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.choice-group {
  display: grid;
  gap: 8px;
}

.choice-group label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
  color: var(--ink);
  font-weight: 800;
}

button,
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  font: inherit;
}

.button.primary,
button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.active,
.follow-btn.active {
  background: #e9f7f4;
  border-color: #b9dfd8;
  color: #087769;
}

.button.wide {
  width: 100%;
}

.sidebar {
  position: sticky;
  top: 92px;
  padding: 18px;
}

.mini-profile {
  gap: 14px;
  margin-bottom: 10px;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff1f5;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 10px;
}

.sidebar-bio {
  color: var(--muted);
  margin: 8px 0 14px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.mini-stats a {
  display: grid;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: #fbfbf9;
}

.mini-stats strong {
  font-size: 18px;
}

.mini-stats span,
.privacy-summary {
  color: var(--muted);
  font-size: 13px;
}

.privacy-summary,
.quick-links {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.privacy-summary {
  padding: 12px;
  border-radius: 8px;
  background: #f7f7f4;
  border: 1px solid var(--line);
}

.quick-links a {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--accent-2);
  font-weight: 800;
}

.auth-panel,
.empty {
  width: min(460px, 100%);
  margin: 48px auto;
  padding: 28px;
}

.empty {
  text-align: center;
}

.auth-panel h1,
.empty h1 {
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.alert {
  padding: 12px;
  border-radius: 8px;
  background: #fff1f1;
  color: #a12222;
  border: 1px solid #ffd0d0;
}

.success {
  padding: 12px;
  border-radius: 8px;
  background: #eefaf4;
  color: #116b42;
  border: 1px solid #bfecd4;
  margin: 14px 0;
}

.install-details {
  padding: 12px;
  border-radius: 8px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  margin: 16px 0;
}

.install-details p,
.success p {
  margin: 6px 0;
}

.muted {
  color: var(--muted);
}

.location-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf7;
}

.location-picker.compact {
  padding: 10px;
}

.location-picker-head,
.location-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.location-search-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.location-map {
  width: 100%;
  height: 260px;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8e8e2;
}

.location-picker.compact .location-map {
  height: 210px;
}

.location-results {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.location-results button {
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  line-height: 1.35;
  background: #fff;
}

.location-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.location-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.location-topbar small {
  display: block;
  color: var(--muted);
}

.location-topbar > div {
  min-width: 0;
}

.location-topbar strong {
  display: block;
  max-width: 100%;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.location-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.location-back::before {
  content: "";
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
}

.location-view-map {
  flex: 1 1 auto;
  width: 100%;
  height: min(72vh, 720px);
  min-height: 420px;
}

.location-map .leaflet-container,
.location-view-map.leaflet-container,
.leaflet-container {
  max-width: 100%;
  touch-action: pan-x pan-y;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  background: #d8e4d1;
  outline: 0;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 10px;
}

.leaflet-right {
  right: 10px;
}

.leaflet-bottom {
  bottom: 10px;
}

.leaflet-left {
  left: 10px;
}

.leaflet-control-zoom {
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.leaflet-control-zoom a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #111;
  background: #fff;
  border-bottom: 1px solid #ddd;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
}

.leaflet-control-attribution {
  padding: 2px 6px;
  background: rgba(255, 255, 255, .8);
  color: #333;
  font-size: 11px;
}

.leaflet-popup {
  position: absolute;
  margin-bottom: 20px;
  text-align: center;
}

.leaflet-popup-content-wrapper {
  padding: 1px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.35;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 20px;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 14px;
  height: 14px;
  margin: -7px auto 0;
  transform: rotate(45deg);
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
}

.map-error {
  display: grid;
  place-items: center;
  min-height: inherit;
  height: 100%;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@media (max-width: 640px) {
  .location-picker-head,
  .location-search-row {
    grid-template-columns: 1fr;
  }

  .location-map,
  .location-picker.compact .location-map {
    height: 280px;
    min-height: 260px;
  }

  .location-view-map {
    min-height: 0;
    height: calc(100vh - 121px);
    height: calc(100dvh - 121px);
  }

  .location-page {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .location-topbar {
    gap: 10px;
    padding: 10px 12px;
  }

  .location-topbar strong {
    font-size: 16px;
  }
}

.post-gallery {
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.gallery-track {
  display: flex;
  transform: translateX(calc(var(--gallery-index, 0) * -100%));
  transition: transform .22s ease;
}

.gallery-slide {
  display: grid;
  place-items: center;
  flex: 0 0 100%;
  min-width: 100%;
  background: #ecece8;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  max-width: 2.5rem;
  max-height: 2.5rem;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .9);
  color: #111827;
  font-size: 0;
  line-height: 0;
  transform: translateY(-50%);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .18), 0 4px 6px -4px rgba(0, 0, 0, .18);
  outline: 1px solid rgba(17, 24, 39, .1);
  backdrop-filter: blur(8px);
  appearance: none;
  flex: 0 0 2.5rem;
  aspect-ratio: 1 / 1;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.gallery-nav:hover {
  background: #fff;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .22), 0 8px 10px -6px rgba(0, 0, 0, .22);
  transform: translateY(-50%) scale(1.04);
}

.gallery-nav:focus-visible {
  outline: 3px solid rgba(231, 72, 105, .35);
  outline-offset: 2px;
}

.gallery-nav[hidden] {
  display: none;
}

.gallery-nav span {
  width: .625rem;
  height: .625rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.gallery-prev span {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.gallery-next span {
  transform: rotate(45deg);
  margin-right: 4px;
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.like-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  color: rgba(255, 255, 255, .96);
  font-size: 78px;
  line-height: 1;
  text-shadow: 0 10px 32px rgba(0, 0, 0, .35);
  pointer-events: none;
  animation: likePulse .72s ease-out both;
}

.like-pulse.liked {
  color: rgba(231, 72, 105, .96);
}

@keyframes likePulse {
  0% {
    opacity: 0;
    transform: scale(.45);
  }
  24% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.38);
  }
}

.tag-link {
  color: var(--accent-2);
  font-weight: 800;
}

.edit-link {
  color: var(--accent-2);
}

.report-open {
  color: #9a364d;
}

.manage-open {
  color: #51616f;
}

.owner-delete-open {
  color: #a13333;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 18, .45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.avatar-modal-panel {
  width: min(520px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.modal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wide-panel {
  width: min(860px, 100%);
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.list-row {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.list-row.unread {
  border-color: #f3a6b9;
  background: #fff5f7;
}

.list-row p {
  margin: 4px 0;
}

.notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notification-row > a:first-child {
  min-width: 0;
}

.notification-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.notification-arrow {
  color: var(--accent-2);
  font-weight: 800;
  white-space: nowrap;
}

.request-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.request-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.request-actions button[data-decision="reject"] {
  background: #fff;
  color: #8a2f43;
  border-color: #efbdc8;
}

.block-user-btn {
  color: #8a2f43;
  border-color: #efbdc8;
}

.block-user-btn.active {
  background: #f3f3ef;
  color: var(--ink);
}

.notification-highlight {
  animation: notificationFlash 2.2s ease-out both;
}

.notification-highlight-done {
  outline: 0;
}

@keyframes notificationFlash {
  0% {
    background-color: #fff3a6;
    box-shadow: 0 0 0 4px rgba(255, 211, 64, .55);
  }
  35% {
    background-color: #fff7c8;
    box-shadow: 0 0 0 7px rgba(255, 211, 64, .28);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 rgba(255, 211, 64, 0);
  }
}

.messages-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.message-side {
  position: static;
}

.chat {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.chat p {
  justify-self: start;
  max-width: 76%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f0eb;
}

.chat p.mine {
  justify-self: end;
  background: #e9f7f4;
}

.admin-report {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

.admin-report img,
.edit-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  gap: 8px;
}

.admin-actions.compact {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.admin-shell {
  display: grid;
  gap: 16px;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.admin-hero h1,
.admin-hero p {
  margin: 0;
}

.admin-hero p {
  color: var(--muted);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.admin-metrics article,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-metrics article {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.admin-metrics strong {
  font-size: 24px;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 13px;
}

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

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .75fr);
  gap: 14px;
}

.admin-card {
  padding: 14px;
}

.admin-card h2 {
  margin: 0;
  font-size: 18px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-card-head span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stack-form,
.compact-list,
.audit-compact {
  display: grid;
  gap: 10px;
}

.compact-report {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.compact-report.small {
  grid-template-columns: 58px minmax(0, 1fr);
}

.compact-thumb img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
}

.compact-report.small .compact-thumb img {
  width: 58px;
  height: 58px;
}

.compact-report p {
  margin: 0 0 4px;
}

.compact-report small,
.compact-row span,
.audit-compact small,
.audit-compact em {
  color: var(--muted);
}

.moderation-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  gap: 6px;
  margin-top: 8px;
}

.moderation-mini.two {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

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

.audit-compact article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.audit-compact span,
.audit-compact em,
.audit-compact small {
  display: block;
  font-style: normal;
  margin-top: 3px;
}

.moderation-log-panel {
  width: min(900px, 96vw);
}

.moderation-log-list {
  display: grid;
  gap: 10px;
  max-height: min(64vh, 620px);
  overflow-y: auto;
  padding-right: 4px;
}

.moderation-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.moderation-log-main strong,
.moderation-log-main span,
.moderation-log-main em,
.moderation-log-main small,
.moderation-log-post span,
.moderation-log-post small {
  display: block;
}

.moderation-log-main em,
.moderation-log-main small,
.moderation-log-post small {
  color: var(--muted);
  font-style: normal;
  margin-top: 3px;
}

.moderation-log-post {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.moderation-log-post img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.appeal-panel {
  display: grid;
  gap: 18px;
}

.appeal-layout {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.appeal-photo {
  display: grid;
  gap: 8px;
}

.appeal-photo img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.appeal-details {
  display: grid;
  gap: 12px;
}

.appeal-details h2,
.appeal-details p {
  margin: 0;
}

.moderation-reason {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #f1c7d0;
  border-radius: 8px;
  background: #fff5f7;
}

.moderation-reason small {
  color: var(--muted);
}

.appeal-details textarea {
  min-height: 140px;
}

.post-status-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.post-status-warning.moderation {
  background: #fff1b8;
  color: #594500;
}

.post-status-warning.private {
  background: #edede8;
  color: #54544e;
}

.post-status-warning span {
  color: inherit;
}

.post-status-warning a {
  margin-left: auto;
  font-weight: 900;
  color: var(--accent-2);
}

.post-status-warning form {
  margin-left: auto;
}

.post-status-warning button {
  min-height: 34px;
}

.visibility-edit-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-table a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 90px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.user-result {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.user-result small,
.user-result em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.edit-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.avatar-edit {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-preview {
  width: 150px;
  height: 150px;
  overflow: hidden;
  border-radius: 50%;
  background: #ecece8;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 46px;
  font-weight: 800;
}

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

.avatar-modal-preview {
  display: grid;
  place-items: center;
  width: min(320px, 80vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #ecece8;
  color: var(--muted);
  font-size: 72px;
  font-weight: 800;
}

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

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: auto;
}

.settings-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.settings-menu {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.settings-menu h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.settings-menu a {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.settings-menu a:hover {
  color: var(--accent);
}

.settings-content {
  display: grid;
  gap: 16px;
}

.settings-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.settings-section {
  display: grid;
  grid-template-columns: minmax(170px, .45fr) minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-section h2,
.settings-section p {
  margin: 0;
}

.settings-section p {
  color: var(--muted);
  margin-top: 4px;
}

.avatar-settings {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-toggles {
  display: grid;
  gap: 12px;
}

.conversation-row strong,
.conversation-row small {
  display: block;
}

.conversation-row small {
  color: var(--muted);
  margin-top: 3px;
}

.conversation-row.active {
  border-color: #f3a6b9;
  background: #fff5f7;
}

.profile-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 26px 0 34px;
  border-bottom: 1px solid var(--line);
}

.profile-title {
  gap: 16px;
  flex-wrap: wrap;
}

.profile-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.stats {
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0;
}

.profile-info h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.follow-request-panel,
.private-profile-box {
  margin-top: 22px;
}

.follow-request-row .user-result {
  border: 0;
  padding: 0;
  background: transparent;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 28px;
}

.tile {
  position: relative;
  overflow: hidden;
  background: #e8e8e2;
  aspect-ratio: 1 / 1;
}

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

.tile-link {
  display: block;
  width: 100%;
  height: 100%;
}

.tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  opacity: 0;
  transition: opacity .15s ease;
  font-weight: 800;
}

.tile-multiple-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 24px;
  height: 24px;
  pointer-events: none;
  opacity: .74;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}

.tile-multiple-badge::before,
.tile-multiple-badge::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .96);
  border-radius: 4px;
  background: rgba(0, 0, 0, .08);
}

.tile-multiple-badge::before {
  top: 3px;
  left: 6px;
}

.tile-multiple-badge::after {
  top: 7px;
  left: 2px;
}

.tile-warning {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.tile-warning.moderation {
  background: #ffe28a;
  color: #5a4300;
}

.tile-warning.private {
  background: #e4e4df;
  color: #565650;
}

.tile-status-hidden img,
.tile-status-private img {
  filter: saturate(.65);
}

.tile-status-hidden .tile-overlay,
.tile-status-private .tile-overlay {
  top: auto;
  bottom: 0;
  height: 42px;
  opacity: 1;
  background: rgba(0, 0, 0, .58);
}

.tile-status-hidden:hover .tile-overlay,
.tile-status-private:hover .tile-overlay {
  opacity: 1;
}

.tile-visibility-form {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.tile-visibility-form button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: #e4e4df;
  color: var(--ink);
  font-size: 13px;
}

.single-post {
  width: min(720px, 100%);
  margin: 0 auto;
}

.tile:hover .tile-overlay {
  opacity: 1;
}

.span {
  grid-column: 1 / -1;
}

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

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

  .sidebar {
    display: none;
  }

  .message-side {
    display: block;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .shell {
    width: 100%;
    margin: 0;
  }

  .post,
  .auth-panel,
  .empty {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-panel,
  .empty {
    margin: 0;
    width: 100%;
  }

  .profile-hero {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 18px;
    padding: 22px 16px;
  }

  .avatar.huge {
    width: 82px;
    height: 82px;
    font-size: 32px;
  }

  .grid {
    gap: 2px;
    margin-top: 0;
  }

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

  .admin-grid,
  .admin-dashboard-grid,
  .admin-metrics,
  .appeal-layout,
  .admin-actions.compact,
  .moderation-mini,
  .moderation-mini.two,
  .modal-actions,
  .audit-compact,
  .search-form,
  .admin-table a {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .compact-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-hero-actions,
  .moderation-log-row {
    grid-template-columns: 1fr;
  }

  .admin-hero-actions {
    align-items: stretch;
  }

  .moderation-log-post {
    padding-left: 0;
    padding-top: 10px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .settings-shell,
  .settings-section,
  .avatar-settings {
    grid-template-columns: 1fr;
  }

  .settings-menu {
    position: static;
  }

}
