:root {
  --bg: #f3efe6;
  --bg-2: #e7f0ea;
  --ink: #1d2a24;
  --muted: #5c6b63;
  --brand: #0f6b5c;
  --brand-2: #c45c26;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(29, 42, 36, 0.12);
  --shadow: 0 18px 40px rgba(29, 42, 36, 0.08);
  --radius: 18px;
  --font: "Vazirmatn", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, #d9ebe3 0%, transparent 55%),
    radial-gradient(900px 420px at -10% 0%, #f7e2d3 0%, transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100vh;
  line-height: 1.7;
  font-size: 18px;
}

.wrap { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { position: sticky; top: 0; backdrop-filter: blur(10px); background: rgba(243, 239, 230, 0.85); border-bottom: 1px solid var(--line); z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; gap: 1rem; }
.brand { font-weight: 700; font-size: 1.35rem; color: var(--brand); text-decoration: none; letter-spacing: -0.02em; }
.nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--brand); }
.main { padding: 1.5rem 0 3rem; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; color: var(--muted); font-size: 0.95rem; }

.hero { padding: 2.2rem 0 1.2rem; animation: rise 0.7s ease both; }
.brand-hero { margin: 0; font-size: clamp(2.2rem, 6vw, 3.6rem); color: var(--brand); letter-spacing: -0.03em; }
.lede { color: var(--muted); max-width: 38rem; font-size: 1.1rem; }
.search-form { display: flex; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.search-form input, .stack input, .stack textarea, .stack select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
}
.search-form input { flex: 1; min-width: 220px; }
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 0.75rem 1.2rem;
  background: var(--brand); color: #fff; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); background: #0c574b; }
.btn-secondary { background: #2f3d36; }
.btn-danger { background: #9b2c2c; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.9rem; }

.filters { display: grid; gap: 1.2rem; margin: 1.5rem 0 2rem; }
.filter-group h2 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  text-decoration: none; border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.95rem;
}
.chip.is-active, .chip:hover { background: var(--brand); color: #fff; border-color: transparent; }

.tone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tone {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); animation: rise 0.6s ease both;
}
.tone-cover {
  height: 140px;
  background:
    linear-gradient(135deg, rgba(15,107,92,0.85), rgba(196,92,38,0.75)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Ccircle cx='60' cy='60' r='28' fill='none' stroke='white' stroke-width='4'/%3E%3Ccircle cx='60' cy='60' r='6' fill='white'/%3E%3C/svg%3E") center/48px no-repeat,
    #0f6b5c;
  background-size: cover, 48px, auto;
  background-position: center, center, center;
}
.tone-body { padding: 1rem; }
.tone-body h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.tone-body h3 a { color: inherit; text-decoration: none; }
.meta { color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0 0.8rem; }
.tone-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1.5rem; }
.pagination a { padding: 0.4rem 0.75rem; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: #fff; }
.pagination a.is-active { background: var(--brand); color: #fff; border-color: transparent; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 1.5rem 0 0.8rem; }
.list-head h2 { margin: 0; font-size: 1.35rem; color: var(--brand); }
.list-head a { color: var(--muted); text-decoration: none; font-weight: 600; }
.list-head.sub { margin: 0.8rem 0 0.6rem; }
.list-head.sub h3 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.category-list { margin-bottom: 1.2rem; }
.site-player { width: min(1100px, calc(100% - 2rem)); margin: 1rem auto 0; display: block; }

.detail { padding: 1rem 0 2rem; animation: rise 0.6s ease both; }
.detail-actions { margin-top: 1.2rem; }
.auth-box, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: var(--shadow); max-width: 520px;
}
.admin .panel { max-width: none; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stack { display: grid; gap: 0.75rem; }
.stack label { display: grid; gap: 0.35rem; font-weight: 600; }
.check { display: flex !important; align-items: center; gap: 0.5rem; font-weight: 600; }
.error { color: #9b2c2c; background: #fdecec; padding: 0.7rem 0.9rem; border-radius: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 0.7rem; border-bottom: 1px solid var(--line); }
.cat-admin-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.cat-admin-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

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

@media (max-width: 640px) {
  body { font-size: 17px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}
