.profile-posts--wall {
  --pp-bg: var(--card, #1a1a1a);
  --pp-border: var(--transparent-5-w, rgba(255,255,255,0.06));
  --pp-text: var(--text-default, #e0e0e0);
  --pp-muted: var(--text-secondary, #888);
  --pp-accent: var(--span, #7c3aed);
}

.profile-posts__header {
  margin-bottom: 1.25rem;
}

.profile-posts__title {
  font-size: var(--font-size-xl, 1.25rem);
  font-weight: 700;
  color: var(--pp-text);
  margin: 0;
}

.profile-posts__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-posts__admin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-posts__admin-btn {
  width: 40px;
  height: 40px;
}

.profile-posts__admin-btn svg {
  flex-shrink: 0;
}

.profile-posts__form.card {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--pp-border);
}

.profile-posts-form__field {
  position: relative;
  margin-bottom: 1rem;
}

.profile-posts-form__textarea {
  resize: vertical;
}

.profile-posts-form__textarea::placeholder {
  color: var(--pp-muted);
}

.profile-posts-form__counter {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--pp-muted);
}

.profile-posts-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-posts-form__draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
}

.profile-posts-form__draw:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-posts-form__submit {
  color: #fff;
  background: var(--pp-accent);
}

.profile-posts-form__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.profile-posts-form__preview-wrap {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pp-border);
  border-radius: var(--br-10);
}

.profile-posts-form__preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.profile-posts-form__preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--br-10);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--pp-border);
}

.profile-posts-form__preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-posts-form__preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.profile-posts-form__preview-remove:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: scale(1.08);
}

.profile-posts-form__preview-remove:active {
  transform: scale(0.95);
}

.profile-posts-form__preview-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--pp-muted);
}

.profile-posts__error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #c92a2a;
  background: rgba(201, 42, 42, 0.1);
  border: 1px solid rgba(201, 42, 42, 0.3);
  border-radius: var(--br-10);
}

.profile-posts__login-hint {
  padding: 1rem;
  text-align: center;
  color: var(--pp-muted);
  margin-bottom: 1.5rem;
}

.profile-posts__empty {
  padding: 2rem;
  text-align: center;
  color: var(--pp-muted);
  margin: 0;
}

.profile-posts__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-posts__item.card {
  padding: 1rem 1.25rem;
  border-radius: var(--br-16);
  border: 1px solid var(--pp-border);
  background: var(--pp-bg);
}

.profile-posts__item-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.profile-posts__item-author-link {
  flex-shrink: 0;
  display: block;
  line-height: 0;
}

.profile-posts__item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.profile-posts__item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.profile-posts__item-author {
  display: inline-block;
  font-weight: 600;
  color: var(--pp-text);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}

.profile-posts__item-author:hover {
  color: var(--pp-accent);
}

.profile-posts__item-date {
  font-size: 0.8125rem;
  color: var(--pp-muted);
}

.profile-posts__item-delete-form {
  flex-shrink: 0;
  display: inline;
}

.profile-posts__item-delete {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--pp-muted);
  background: transparent;
  border: none;
  border-radius: var(--br-10);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.profile-posts__item-delete:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.profile-posts__item-body {
  padding-left: 52px;
}

@media (max-width: 576px) {
  .profile-posts__item-body {
    padding-left: 0;
  }
}

.profile-posts__item-content {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--pp-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-posts__item-images {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.profile-posts__item-image {
  border-radius: var(--br-10);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}

.profile-posts__item-image img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.profile-posts.profile-posts--wall .profile-posts__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.profile-posts.profile-posts--wall .profile-posts__pagination-btn {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  padding: 0 14px;
  color: var(--pp-text, #e0e0e0);
  border: 1px solid var(--pp-border, rgba(255, 255, 255, 0.08));
  cursor: pointer;
}

.profile-posts.profile-posts--wall .profile-posts__pagination-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--pp-accent, #7c3aed);
}

.profile-posts.profile-posts--wall .profile-posts__pagination-btn--current {
  background: var(--pp-accent);
  border-color: var(--pp-accent);
  color: #fff;
  pointer-events: none;
  cursor: default;
}

.profile-posts.profile-posts--wall .profile-posts__pagination-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.profile-posts.profile-posts--wall .profile-posts__pagination-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.profile-posts.profile-posts--wall .profile-posts__pagination-btn:not(.profile-posts__pagination-btn--disabled):hover svg {
  transform: scale(1.1);
}

.profile-posts.profile-posts--wall .profile-posts__pagination-dots {
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pp-muted, #888);
  font-size: 15px;
  font-weight: 500;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  letter-spacing: 2px;
}

@media (max-width: 768px) {
  .profile-posts.profile-posts--wall .profile-posts__pagination {
    gap: 4px;
    margin-top: 1.25rem;
  }

  .profile-posts.profile-posts--wall .profile-posts__pagination-btn {
    min-width: 40px;
    height: 40px;
    font-size: 14px;
    padding: 0 10px;
  }

  .profile-posts.profile-posts--wall .profile-posts__pagination-dots {
    min-width: 40px;
    height: 40px;
    font-size: 14px;
  }
}

#profile-posts-modal-settings .popup_modal_content,
#profile-posts-modal-moderation .popup_modal_content {
  --pp-bg: var(--card, #1a1a1a);
  --pp-border: var(--transparent-5-w, rgba(255,255,255,0.06));
  --pp-text: var(--text-default, #e0e0e0);
  --pp-muted: var(--text-secondary, #888);
  --pp-accent: var(--span, #7c3aed);
}

.profile-posts__settings-form .profile-posts__settings-field {
  margin-bottom: 1rem;
}

.profile-posts__settings-form .profile-posts__settings-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--pp-muted);
}

.profile-posts__modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.profile-posts__modal-close,
.profile-posts__modal-submit {
  padding: 0.5rem 1rem;
  border-radius: var(--br-10, 8px);
  font-size: 0.9375rem;
  cursor: pointer;
}

.profile-posts__modal-close {
  border: 1px solid var(--pp-border);
  background: transparent;
  color: var(--pp-text);
}

.profile-posts__modal-submit {
  border: none;
  background: var(--pp-accent);
  color: #fff;
}

#profile-posts-modal-moderation .profile-posts__moderation-body {
  max-height: min(60vh, 480px);
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.04);
}

#profile-posts-modal-moderation .profile-posts__moderation-body::-webkit-scrollbar {
  width: 8px;
}

#profile-posts-modal-moderation .profile-posts__moderation-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

#profile-posts-modal-moderation .profile-posts__moderation-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

#profile-posts-modal-moderation .profile-posts__moderation-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.profile-posts__moderation-loading {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--pp-muted);
  font-size: 0.9375rem;
}

.profile-posts__moderation-empty {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--pp-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.profile-posts__moderation-list {
  margin: 0;
}

.profile-posts__moderation-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-posts__moderation-item.card {
  padding: 1rem 1.25rem;
  margin: 0;
  border: 1px solid var(--pp-border);
  border-radius: var(--br-16, 12px);
  background: var(--pp-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-posts__moderation-item.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-posts__moderation-item-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.profile-posts__moderation-item-head a {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--pp-accent);
  text-decoration: none;
  transition: color 0.2s;
}

.profile-posts__moderation-item-head a:hover {
  color: var(--pp-text);
  text-decoration: underline;
}

.profile-posts__moderation-meta {
  font-size: 0.75rem;
  color: var(--pp-muted);
  font-family: ui-monospace, monospace;
  letter-spacing: 0.02em;
}

.profile-posts__moderation-item-body {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--pp-text);
  margin-bottom: 0.75rem;
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.profile-posts__moderation-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#profile-posts-modal-draw .popup_modal_content {
  max-width: 810px;
  width: 100%;
}

.profile-posts__draw-modal-content .profile-posts__draw-body {
  padding: 1rem 0 1.25rem;
}

.profile-posts__draw-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pp-border);
  border-radius: var(--br-16, 12px);
  justify-content: space-between;
}

.profile-posts__draw-tools,
.profile-posts__draw-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.profile-posts__draw-tool,
.profile-posts__draw-action {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pp-border);
  border-radius: var(--br-10);
  background: rgba(255, 255, 255, 0.06);
  color: var(--pp-text);
  cursor: pointer;
}

.profile-posts__draw-tool.is-active,
.profile-posts__draw-action:active {
  border-color: var(--pp-accent);
}

.profile-posts__draw-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-posts__draw-size-label {
  font-size: 0.8125rem;
  color: var(--pp-muted);
  font-weight: 500;
}

.profile-posts__draw-size-dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.profile-posts__draw-size-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pp-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--pp-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.profile-posts__draw-size-dot:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--pp-accent);
  transform: scale(1.08);
}

.profile-posts__draw-size-dot.is-active {
  border-color: var(--pp-accent);
  box-shadow: 0 0 0 1px var(--pp-accent);
}

.profile-posts__draw-colors-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pp-border);
  border-radius: var(--br-16, 12px);
}

.profile-posts__draw-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.profile-posts__draw-color {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.profile-posts__draw-color:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-posts__draw-colorpicker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-left: auto;
}

.profile-posts__draw-colorpicker-label {
  font-size: 0.8125rem;
  color: var(--pp-muted);
  font-weight: 500;
}

.profile-posts__draw-colorpicker {
  width: 40px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-posts__draw-colorpicker:hover {
  border-color: var(--pp-accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.profile-posts__draw-colorpicker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.profile-posts__draw-colorpicker::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.profile-posts__draw-canvas-wrap {
  margin-bottom: 1.25rem;
  border-radius: var(--br-16, 12px);
  overflow: hidden;
  border: 1px solid var(--pp-border);
  background: #1a1a1a;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-posts__draw-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 280px;
  cursor: crosshair;
  -ms-touch-action: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

#profile-posts-modal-draw .profile-posts__modal-actions {
  margin-top: 0;
  padding-top: 0.5rem;
  gap: 1rem;
}

#profile-content-wrapper.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

@media (max-width: 480px) {

  .profile-posts__title {
    font-size: 1.0625rem;
  }

  .profile-posts__form.card {
    padding: 0.875rem;
    margin-bottom: 1rem;
  }

  .profile-posts-form__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
  }

  .profile-posts-form__actions .inputs-inline {
    width: 100%;
  }

  .profile-posts-form__draw {
    width: 100%;
    height: 40px;
    border-radius: var(--br-10);
  }

  .profile-posts-form__submit {
    width: 100%;
  }

  .profile-posts-form__preview {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 0.5rem;
  }

  .profile-posts__item.card {
    padding: 0.875rem 1rem;
  }

  .profile-posts__item-head {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .profile-posts__item-avatar {
    width: 34px;
    height: 34px;
  }

  .profile-posts__item-author {
    font-size: 0.875rem;
  }

  .profile-posts__item-body {
    padding-left: 0;
  }

  .profile-posts__item-content {
    font-size: 0.875rem;
  }

  .profile-posts__item-images {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.375rem;
  }

  .profile-posts__item-image img {
    max-height: 200px;
  }

  .profile-posts__modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .profile-posts__modal-close,
  .profile-posts__modal-submit {
    width: 100%;
    text-align: center;
  }

  .profile-posts__moderation-item.card {
    padding: 0.75rem 0.875rem;
  }

  .profile-posts__moderation-item-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-posts__moderation-item-actions .button,
  .profile-posts__moderation-item-actions .profile-posts__moderation-delete {
    width: 100%;
    justify-content: center;
  }

  .profile-posts__draw-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
  }

  .profile-posts__draw-tools,
  .profile-posts__draw-actions {
    gap: 0.3rem;
  }

  .profile-posts__draw-tool,
  .profile-posts__draw-action {
    width: 36px;
    height: 36px;
  }

  .profile-posts__draw-size-dot {
    width: 32px;
    height: 32px;
  }

  .profile-posts__draw-colors-row {
    padding: 0.625rem 0.75rem;
    gap: 0.625rem 0.75rem;
  }

  .profile-posts__draw-color {
    width: 28px;
    height: 28px;
  }

  .profile-posts__draw-colorpicker-wrap {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .profile-posts__draw-canvas {
    min-height: 200px;
  }

  #profile-posts-modal-draw .profile-posts__modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  #profile-posts-modal-draw .profile-posts__draw-cancel,
  #profile-posts-modal-draw .profile-posts__draw-save {
    width: 100%;
    text-align: center;
  }
}
