:root {
  --bg: #f4efe7;
  --bg-2: #efe3d2;
  --ink: #1f1f1b;
  --muted: #6d6358;
  --accent: #0f6f5c;
  --accent-2: #b24823;
  --card: #fffdf9;
  --border: #e3d6c5;
  --shadow: 0 12px 30px rgba(37, 30, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, var(--bg-2), var(--bg));
  color: var(--ink);
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hero {
  margin-top: 24px;
}

.hero-card {
  background: linear-gradient(135deg, #fffdf9 0%, #f8f0e5 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-card h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

.hero-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.hero-meta .dot {
  opacity: 0.6;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

main {
  padding: 20px 0 50px;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.wall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.wall-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.guide {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wall {
  column-count: 3;
  column-gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  width: 100%;
  break-inside: avoid;
  margin: 0 0 20px;
}

.card p {
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.6;
}

.ad-card {
  border-style: dashed;
  background: #fff9f1;
}

.ad-card h4 {
  margin: 0;
  font-size: 1rem;
}
.meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.mood {
  font-size: 0.8rem;
  color: var(--accent-2);
}

.badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e8d7c2;
  background: #fff5e6;
  color: #8a5a2b;
}

.badge.warning {
  background: #fff0f0;
  border-color: #f1c7c7;
  color: #8a2e2e;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-top: 24px;
  position: relative;
  overflow: visible;
}

textarea,
select,
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  text-align: right;
}

select {
  appearance: auto;
  -webkit-appearance: menulist;
  background-color: #fff;
  position: relative;
  z-index: 2;
  line-height: 1.6;
  max-width: 100%;
  direction: rtl;
}

.filter-form select {
  width: auto;
  min-width: 160px;
  flex: 1 1 160px;
}

button,
.button {
  background: #efe3d2;
  color: var(--ink);
  padding: 12px 20px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover,
.button:hover {
  filter: brightness(0.98);
}

button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button.primary,
button.primary {
  background: var(--accent);
  color: #fff;
}

button.secondary {
  background: #b89b82;
}

button.danger {
  background: #7c2d18;
}

button.quiet,
.button.quiet {
  background: #efe3d2;
  color: var(--ink);
  border: 1px solid var(--border);
}

button.small,
.button.small {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 12px;
}

.reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: auto;
  align-self: flex-end;
}

.reactions form {
  margin: 0;
}

.footer {
  padding: 24px 0 30px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.notice {
  padding: 12px 14px;
  background: #fff5e6;
  border-radius: 12px;
  border: 1px solid #e9c9a1;
  margin-top: 16px;
}

.notice-inline {
  padding: 8px 12px;
  background: #fff5e6;
  border-radius: 12px;
  border: 1px solid #e9c9a1;
  font-size: 0.85rem;
  color: var(--muted);
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--ink);
  background: #efe3d2;
  text-decoration: none;
}

.icon-link:hover {
  text-decoration: none;
}

.menu {
  position: relative;
}

.menu-panel {
  position: absolute;
  left: 0;
  bottom: 40px;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 10;
}

.menu.open .menu-panel {
  display: block;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: none;
  text-align: right;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.menu-item:hover {
  background: #f4efe7;
}

.chip:focus-visible,
.icon-link:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reactions button.small,
.reactions .button.small {
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
}

.pagination {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.mobile-cta {
  display: none;
}

.view-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.view-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
}

body[data-view="three"] .view-icon-rows {
  display: block;
}

body[data-view="single"] .view-icon-cols {
  display: block;
}

.wall[data-view="single"] {
  column-count: 1;
}

.wall[data-view="three"] {
  column-count: 3;
}

@media (max-width: 1100px) {
  .wall[data-view="three"] {
    column-count: 2;
  }
}

.page-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.dialog-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  width: min(680px, 92vw);
  background: var(--card);
  box-shadow: var(--shadow);
  max-height: min(90vh, 720px);
  overflow: auto;
}

.dialog-panel::backdrop {
  background: rgba(31, 31, 27, 0.45);
  backdrop-filter: blur(2px);
}

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

.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dialog-panel .notice-inline {
  margin-bottom: 14px;
}

.dialog-panel form {
  gap: 16px;
}

.copy-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.copy-actions + .copy-actions {
  margin-top: 12px;
}

.copy-actions input {
  direction: ltr;
  text-align: left;
}


.form-block form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-block button {
  align-self: flex-start;
}

@media (max-width: 720px) {
  .wall-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-card {
    padding: 20px;
  }

  .mobile-cta {
    display: block;
    position: sticky;
    bottom: 12px;
    margin-top: 16px;
    z-index: 5;
  }

  .wall {
    column-count: 1;
  }
}

.honeypot {
  display: none;
}

@media (max-width: 720px) {
  main {
    padding: 16px 0 32px;
  }

  .wall-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeUp 0.6s ease both;
}

.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.06s; }
.card:nth-child(4) { animation-delay: 0.08s; }
.card:nth-child(5) { animation-delay: 0.10s; }
.card:nth-child(6) { animation-delay: 0.12s; }
.dialog-panel[open] {
  display: block;
}

.dialog-panel:not([open]) {
  display: none;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1f1f1b;
  color: #fff;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .card {
    opacity: 1;
    transform: none;
  }
}
