/* =========================================================
   Kézfogás — Warm editorial stylesheet
   Color: cream paper, deep ink, muted Hungarian red, sage
   Type: Fraunces (display) + Karla (body)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,300;1,9..144,400&family=Karla:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette */
  --paper:        #f6efe1;     /* warm cream */
  --paper-deep:   #ede4d0;     /* slightly darker paper */
  --ink:          #1c1813;     /* deep warm black */
  --ink-soft:     #4a3f33;     /* softer brown ink */
  --ink-muted:    #786a58;     /* muted body */
  --rule:         #d8cbb0;     /* hairline color */
  --paprika:      #a83b2a;     /* muted Hungarian red */
  --paprika-deep: #832c1f;
  --paprika-soft: #d8a89e;     /* tinted */
  --sage:         #5e6b4a;     /* olive-sage */
  --sage-soft:    #b5bda5;
  --gold:         #b89150;     /* aged brass */

  /* Typography */
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans:  "Karla", "Helvetica Neue", system-ui, sans-serif;

  /* Spacing */
  --container: 1180px;
  --container-narrow: 760px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* Subtle paper grain via CSS */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(120,90,40,0.04) 1px, transparent 1px),
    radial-gradient(rgba(120,90,40,0.03) 1px, transparent 1px);
  background-position: 0 0, 8px 12px;
  background-size: 16px 16px, 16px 16px;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* Ensure content is above the grain overlay */
header, main, footer { position: relative; z-index: 2; }
header { z-index: 100; }

/* ---------- Layout helpers ---------- */
.container       { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container-narrow{ max-width: var(--container-narrow); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paprika);
  font-weight: 600;
}

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* Section headings */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
}
.section-title em { font-style: italic; color: var(--paprika); }

.section-subtitle {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 18px;
  margin-top: 0;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  gap: 24px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 36px; height: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  color: var(--ink);
  background: var(--paper);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: -5px;
  border: 1px solid var(--rule);
  border-radius: 50%;
}
.brand-text {
  display: flex; flex-direction: column; line-height: 1;
}
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 500;
}
.brand-tagline {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 6px;
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: color .2s;
}
.nav a:hover, .nav a.active { color: var(--paprika); }
.nav a.active::after {
  content:""; position:absolute; left:0; right:0; bottom:-2px;
  height: 1.5px; background: var(--paprika);
}

/* Language switcher */
.lang-switch {
  display: flex; gap: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
  background: var(--paper-deep);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-muted);
  border-radius: 999px;
  transition: all .18s;
}
.lang-switch button.active {
  background: var(--ink);
  color: var(--paper);
}

/* Mobile nav toggle */
.menu-toggle { display: none; background: transparent; border: 0; padding: 8px; }
.menu-toggle svg { width: 24px; height: 24px; stroke: var(--ink); }

@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 12px 28px 20px; align-items: flex-start; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: 0; }
  .menu-toggle { display: block; }
  .header-inner { position: relative; }
  .lang-switch { order: 2; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 100px;
  overflow: hidden;
}
.hero::after {
  /* Decorative folk-inspired ornament */
  content: "";
  position: absolute;
  right: -40px; top: 60px;
  width: 380px; height: 380px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><pattern id='hatch' patternUnits='userSpaceOnUse' width='4' height='4' patternTransform='rotate(35)'><line x1='0' y1='0' x2='0' y2='4' stroke='%23a83b2a' stroke-width='0.5' opacity='0.55'/></pattern><pattern id='cross' patternUnits='userSpaceOnUse' width='4' height='4' patternTransform='rotate(35)'><line x1='0' y1='0' x2='0' y2='4' stroke='%23a83b2a' stroke-width='0.5' opacity='0.55'/><line x1='0' y1='0' x2='4' y2='0' stroke='%23a83b2a' stroke-width='0.4' opacity='0.4'/></pattern></defs><path fill='url(%23hatch)' stroke='%23a83b2a' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round' opacity='0.85' stroke-dasharray='0' d='M 5 200 L 48 162 Q 50 158 53 156 Q 56 153 50 144 Q 44 134 46 124 Q 50 120 56 124 Q 60 130 62 138 Q 65 140 66 130 Q 68 110 71 100 Q 75 96 79 100 Q 81 110 80 124 Q 81 128 84 128 Q 88 116 92 105 Q 96 102 99 105 Q 100 116 98 130 Q 100 134 102 132 Q 105 122 109 114 Q 113 113 115 117 Q 115 128 112 138 Q 113 142 116 140 Q 122 134 126 132 Q 130 134 128 140 Q 124 152 116 162 Q 110 168 100 168 L 70 168 Q 60 166 52 162 L 22 200 Z'/><path fill='none' stroke='%23a83b2a' stroke-width='0.6' opacity='0.55' stroke-linecap='round' stroke-linejoin='round' d='M 6 198 L 49 161 Q 51 157 54 155 Q 57 152 51 143 Q 45 133 47 123 Q 51 119 57 123 Q 61 129 63 137 Q 66 139 67 129 Q 69 109 72 99 Q 76 95 80 99 Q 82 109 81 123 Q 82 127 85 127 Q 89 115 93 104 Q 97 101 100 104 Q 101 115 99 129 Q 101 133 103 131 Q 106 121 110 113 Q 114 112 116 116 Q 116 127 113 137 Q 114 141 117 139 Q 123 133 127 131 Q 131 133 129 139 Q 125 151 117 161 Q 111 167 101 167 L 71 167 Q 61 165 53 161 L 23 199'/><path fill='url(%23hatch)' stroke='%23a83b2a' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round' opacity='0.85' d='M 195 0 L 152 38 Q 150 42 147 44 Q 144 47 150 56 Q 156 66 154 76 Q 150 80 144 76 Q 140 70 138 62 Q 135 60 134 70 Q 132 90 129 100 Q 125 104 121 100 Q 119 90 120 76 Q 119 72 116 72 Q 112 84 108 95 Q 104 98 101 95 Q 100 84 102 70 Q 100 66 98 68 Q 95 78 91 86 Q 87 87 85 83 Q 85 72 88 62 Q 87 58 84 60 Q 78 66 74 68 Q 70 66 72 60 Q 76 48 84 38 Q 90 32 100 32 L 130 32 Q 140 34 148 38 L 178 0 Z'/><path fill='none' stroke='%23a83b2a' stroke-width='0.6' opacity='0.55' stroke-linecap='round' stroke-linejoin='round' d='M 194 1 L 151 39 Q 149 43 146 45 Q 143 48 149 57 Q 155 67 153 77 Q 149 81 143 77 Q 139 71 137 63 Q 134 61 133 71 Q 131 91 128 101 Q 124 105 120 101 Q 118 91 119 77 Q 118 73 115 73 Q 111 85 107 96 Q 103 99 100 96 Q 99 85 101 71 Q 99 67 97 69 Q 94 79 90 87 Q 86 88 84 84 Q 84 73 87 63 Q 86 59 83 61 Q 77 67 73 69 Q 69 67 71 61 Q 75 49 83 39 Q 89 33 99 33 L 129 33 Q 139 35 147 39 L 177 1'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; gap: 28px;
  max-width: 880px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(46px, 8vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 18px 0 24px;
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--paprika);
}
.hero-sub {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 600px;
}
.hero-cta {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 36px;
}

/* Hero animation */
.hero h1, .hero-sub, .hero-cta, .eyebrow-anim {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s cubic-bezier(.2,.7,.2,1) forwards;
}
.eyebrow-anim { animation-delay: 0s; }
.hero h1     { animation-delay: 0.12s; }
.hero-sub    { animation-delay: 0.26s; }
.hero-cta    { animation-delay: 0.4s; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: transform .18s, background .18s, color .18s, border-color .18s;
}
.btn:hover { background: var(--paprika); border-color: var(--paprika); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-arrow svg { width: 16px; height: 16px; transition: transform .2s; }
.btn-arrow:hover svg { transform: translateX(3px); }

/* Inline ghost link */
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-weight: 600;
  color: var(--paprika);
  border-bottom: 1.5px solid var(--paprika-soft);
  padding-bottom: 2px;
  transition: border-color .2s;
}
.link-arrow:hover { border-color: var(--paprika); }

/* ---------- Principles ---------- */
.principles {
  padding: 90px 0;
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
}
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px;
  margin-top: 50px;
}
.principle {
  position: relative;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}
.principle-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--paprika);
  letter-spacing: 0.04em;
}
.principle h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 8px 0 12px;
}
.principle p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.6;
}

/* ---------- Categories strip ---------- */
.cats {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}
.cats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  transition: all .2s;
}
.cat-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper-deep);
  transform: translateY(-1px);
}
.cat-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--paprika);
}
.cat-chip[data-cat="teaching"]  .dot { background: var(--sage); }
.cat-chip[data-cat="care"]      .dot { background: var(--paprika); }
.cat-chip[data-cat="crafts"]    .dot { background: var(--gold); }
.cat-chip[data-cat="culture"]   .dot { background: var(--paprika-deep); }
.cat-chip[data-cat="advice"]    .dot { background: var(--sage); }
.cat-chip[data-cat="tech"]      .dot { background: var(--ink); }
.cat-chip[data-cat="other"]     .dot { background: var(--ink-muted); }

/* ---------- Featured / Cards grid ---------- */
.featured { padding: 90px 0 100px; border-top: 1px solid var(--rule); background: var(--paper); }
.featured-head {
  display: flex; align-items: end; justify-content: space-between;
  flex-wrap: wrap; gap: 20px; margin-bottom: 40px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 28px 26px 26px;
  text-decoration: none;
  color: inherit;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  min-height: 260px;
}
.card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -28px rgba(28,24,19,0.4);
}
.card-cat {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paprika);
  font-weight: 600;
}
.card-cat .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--paprika);
}
.card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 14px 0 12px;
  color: var(--ink);
}
.card p {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
  margin: 0 0 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  margin-top: auto;
}
.card-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.card-meta-item svg { width: 14px; height: 14px; opacity: 0.7; }
.card-online {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--sage-soft);
  color: var(--sage);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- Browse / Filters ---------- */
.page-head {
  padding: 70px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 16px 0 18px;
}
.page-head h1 em { font-style: italic; color: var(--paprika); font-weight: 400; }

.filters {
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-deep);
}
.filters-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto auto;
  gap: 14px;
  align-items: end;
}
@media (max-width: 900px) {
  .filters-row { grid-template-columns: 1fr 1fr; }
  .filters-row > *:nth-child(1) { grid-column: 1 / -1; }
}
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.filter-field input,
.filter-field select {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  border-radius: 6px;
  transition: border-color .15s;
  min-width: 0;
}
.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--ink);
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  font-weight: 500;
}
.checkbox-pill input { margin: 0; accent-color: var(--paprika); }

.btn-reset {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .15s;
}
.btn-reset:hover { border-color: var(--ink); color: var(--ink); }

.results {
  padding: 50px 0 100px;
}
.results-count {
  color: var(--ink-muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 30px;
}

.empty-state {
  text-align: center;
  padding: 80px 30px;
  color: var(--ink-muted);
  font-size: 18px;
  font-style: italic;
  font-family: var(--serif);
}

/* ---------- Forms ---------- */
.form-page {
  padding: 60px 0 100px;
}
.form-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 50px 52px;
  margin-top: 40px;
}
@media (max-width: 600px) {
  .form-card { padding: 32px 24px; }
}

.form-group { margin-bottom: 28px; }
.form-group label {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ink);
}
.form-group .hint {
  display: block;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 10px;
  font-style: italic;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  padding: 13px 16px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  border-radius: 6px;
  transition: border-color .15s, background .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--paprika);
  background: var(--paper);
}
.form-group textarea {
  resize: vertical;
  min-height: 130px;
  font-family: var(--sans);
  line-height: 1.55;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--paper);
  margin: 0;
  transition: all .15s;
}
.checkbox-grid label:has(input:checked) {
  border-color: var(--paprika);
  background: var(--paprika);
  color: var(--paper);
}
.checkbox-grid input { display: none; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--paper-deep);
  border-left: 3px solid var(--sage);
  border-radius: 4px;
  margin: 32px 0;
}
.consent input { margin-top: 4px; flex-shrink: 0; accent-color: var(--paprika); }
.consent label {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.form-success, .form-error {
  display: none;
  padding: 28px 30px;
  border-radius: 6px;
  margin: 30px 0;
  font-size: 16px;
  line-height: 1.55;
}
.form-success {
  background: var(--sage-soft);
  border-left: 4px solid var(--sage);
  color: var(--sage);
}
.form-success.show, .form-error.show { display: block; }
.form-success h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--sage);
}
.form-error {
  background: var(--paprika-soft);
  border-left: 4px solid var(--paprika);
  color: var(--paprika-deep);
}

/* ---------- Detail page ---------- */
.detail {
  padding: 60px 0 100px;
}
.detail-back {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 30px;
  transition: color .15s;
}
.detail-back:hover { color: var(--paprika); }

.detail-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; gap: 36px; }
}

.detail-main h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 14px 0 8px;
  color: var(--ink);
}
.detail-author {
  font-style: italic;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 19px;
  margin-bottom: 36px;
}
.detail-author::before { content: "— "; }

.detail-section { margin-bottom: 36px; }
.detail-section h3 {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.detail-description {
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.detail-meta {
  display: grid;
  gap: 14px;
}
.detail-meta-item {
  display: flex; gap: 14px; align-items: center;
}
.detail-meta-item svg { width: 18px; height: 18px; color: var(--paprika); flex-shrink: 0; }
.detail-meta-item .label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; }
.detail-meta-item .value { font-size: 16px; color: var(--ink); }

/* Contact card */
.contact-card {
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  padding: 32px;
  position: sticky;
  top: 30px;
}
.contact-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.contact-card p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 24px;
}
.contact-card .form-group { margin-bottom: 18px; }
.contact-card .btn { width: 100%; justify-content: center; }

/* ---------- About page ---------- */
.about-content {
  padding: 60px 0 100px;
}
.about-lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.45;
  color: var(--ink);
  border-left: 3px solid var(--paprika);
  padding: 6px 0 6px 28px;
  margin: 30px 0 50px;
  max-width: 720px;
}
.about-content p {
  font-size: 17.5px;
  line-height: 1.78;
  color: var(--ink-soft);
  max-width: 700px;
  margin-bottom: 26px;
}

.faq {
  margin-top: 70px;
  border-top: 1px solid var(--rule);
  padding-top: 50px;
}
.faq-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.015em;
  margin: 0 0 30px;
}
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 22px 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.005em;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 36px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0; top: -2px;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 300;
  color: var(--paprika);
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 70px 0 30px;
  margin-top: 0;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 50px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 36px; } }

.site-footer .brand-mark { border-color: var(--paper); color: var(--paper); background: transparent; }
.site-footer .brand-mark::after { border-color: rgba(246,239,225,0.3); }
.site-footer .brand-name { color: var(--paper); }
.site-footer .brand-tagline { color: rgba(246,239,225,0.6); }

.footer-col h4 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--gold);
}
.footer-col a {
  display: block;
  color: rgba(246,239,225,0.75);
  text-decoration: none;
  padding: 4px 0;
  font-size: 15px;
  transition: color .15s;
}
.footer-col a:hover { color: var(--paper); }
.footer-col p {
  color: rgba(246,239,225,0.65);
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0 0;
}

.footer-bottom {
  border-top: 1px solid rgba(246,239,225,0.15);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(246,239,225,0.5);
  font-size: 13px;
}

/* ---------- Folk pattern divider ---------- */
.folk-divider {
  display: block;
  margin: 0 auto;
  width: 140px;
  height: 24px;
  opacity: 0.5;
}
.folk-divider svg { width: 100%; height: 100%; }

/* ---------- Utilities ---------- */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.fade-in { animation: rise 0.6s cubic-bezier(.2,.7,.2,1) forwards; }

/* =========================================================
   ADDITIONS for two-sided platform (offer + request),
   Jitsi meeting integration, availability, and mobile-first.
   ========================================================= */

/* ---------- Prevent iOS auto-zoom on focus (16px+ on inputs) ---------- */
.filter-field input,
.filter-field select,
.contact-card input,
.contact-card textarea {
  font-size: 16px;
}

/* ---------- Type toggle (offer ↔ request) on post page ---------- */
.type-toggle {
  display: flex;
  gap: 0;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px;
  margin: 0 0 36px;
  width: 100%;
  max-width: 520px;
}
.type-toggle button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 14px 18px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-muted);
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.type-toggle button.active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 4px 14px -6px rgba(28,24,19,0.4);
}
.type-toggle button:not(.active):hover {
  color: var(--ink);
}

/* When request type is active, accent shifts to sage */
.post-form-wrap[data-type="request"] .type-toggle button.active {
  background: var(--sage);
}
.post-form-wrap[data-type="request"] .btn[type="submit"] {
  background: var(--sage);
  border-color: var(--sage);
}
.post-form-wrap[data-type="request"] .btn[type="submit"]:hover {
  background: var(--paprika);
  border-color: var(--paprika);
}

/* ---------- Availability chips (form + display) ---------- */
.availability-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avail-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.avail-chip svg { width: 13px; height: 13px; opacity: 0.6; }

/* On detail page, slightly more prominent */
.detail .avail-chip {
  padding: 8px 16px;
  background: var(--paper-deep);
  font-size: 14px;
  color: var(--ink);
}

/* ---------- Type badge on cards ---------- */
.card-type-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px 14px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border-bottom-left-radius: 4px;
}
.card-type-badge.is-request { background: var(--sage); }

/* Make request cards visually distinct */
.card[data-type="request"] {
  background: linear-gradient(180deg, var(--paper-deep) 0%, var(--paper) 100%);
}
.card[data-type="request"]:hover {
  border-color: var(--sage);
}
.card[data-type="request"] .card-cat {
  color: var(--sage);
}
.card[data-type="request"] .card-cat .dot { background: var(--sage); }

/* ---------- Online meeting (Jitsi) section ---------- */
.meeting-section {
  background: linear-gradient(135deg, var(--paper-deep) 0%, var(--paper) 100%);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  padding: 28px 30px;
  margin: 30px 0;
  border-radius: 4px;
  position: relative;
}
.meeting-section .meeting-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}
.meeting-section .meeting-label svg { width: 14px; height: 14px; }
.meeting-section h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.25;
}
.meeting-section p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 18px;
}
.meeting-section .meeting-note {
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  margin: 14px 0 0;
}
.btn-meeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--gold);
  border: 1.5px solid var(--gold);
  color: #1c1813;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  transition: all .2s;
}
.btn-meeting:hover {
  background: #d4a866;
  border-color: #d4a866;
  transform: translateY(-1px);
}
.btn-meeting svg { width: 16px; height: 16px; }

/* ---------- Two-paths (split) section on home page ---------- */
.split {
  padding: 90px 0;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}
@media (max-width: 760px) {
  .split-grid { grid-template-columns: 1fr; gap: 20px; }
}
.split-card {
  padding: 44px 38px 38px;
  border: 1px solid var(--rule);
  background: var(--paper);
  position: relative;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.split-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -32px rgba(28,24,19,0.4);
}
.split-card .eyebrow { color: var(--paprika); }
.split-card.is-request .eyebrow { color: var(--sage); }
.split-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 14px 0 16px;
  color: var(--ink);
}
.split-card p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 26px;
}
.split-card .btn {
  background: var(--ink);
  border-color: var(--ink);
}
.split-card.is-request .btn { background: var(--sage); border-color: var(--sage); }
.split-card .btn:hover { background: var(--paprika); border-color: var(--paprika); }

@media (max-width: 600px) {
  .split-card { padding: 32px 26px 28px; }
}

/* ---------- Mobile-first improvements ---------- */

/* Hero — tighten spacing and rebalance ornament on small screens */
@media (max-width: 760px) {
  .hero { padding: 56px 0 60px; }
  .hero::after { width: 240px; height: 240px; right: -80px; top: 20px; opacity: 0.6; }
  .hero h1 { font-size: clamp(38px, 9vw, 56px); margin: 14px 0 18px; }
  .hero-sub { font-size: 17px; }
  .hero-cta { gap: 10px; margin-top: 28px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* Principles & cats spacing on mobile */
@media (max-width: 760px) {
  .principles { padding: 56px 0; }
  .cats { padding: 56px 0; }
  .featured { padding: 60px 0 70px; }
  .principles-grid { gap: 28px; margin-top: 32px; }
  .split { padding: 56px 0; }
}

/* Filters mobile: stack everything cleanly */
@media (max-width: 700px) {
  .filters-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .filters-row > * { grid-column: 1 / -1; }
  .checkbox-pill, .btn-reset { width: 100%; justify-content: center; }
}

/* Filter inputs: bigger tap targets */
@media (max-width: 700px) {
  .filter-field input,
  .filter-field select { padding: 14px 14px; }
  .checkbox-pill, .btn-reset { padding: 14px 18px; }
}

/* Page head smaller padding mobile */
@media (max-width: 700px) {
  .page-head { padding: 50px 0 30px; }
  .page-head h1 { font-size: clamp(34px, 8vw, 56px); }
  .results { padding: 30px 0 60px; }
}

/* Detail page — disable sticky on mobile, contact card flows naturally */
@media (max-width: 900px) {
  .contact-card {
    position: static;
    margin-top: 8px;
  }
}

/* Form card mobile padding */
@media (max-width: 480px) {
  .form-card { padding: 26px 18px; }
  .form-page { padding: 36px 0 60px; }
  .form-group { margin-bottom: 24px; }
  .form-group input,
  .form-group select,
  .form-group textarea { padding: 14px 14px; }
}

/* Footer — better stacking */
@media (max-width: 700px) {
  .site-footer { padding: 50px 0 24px; }
  .footer-grid { gap: 28px; margin-bottom: 30px; }
  .footer-bottom { font-size: 12px; }
}

/* Header — improve tap targets and spacing on mobile */
@media (max-width: 860px) {
  .header-inner { padding: 16px 0; gap: 12px; }
  .brand-tagline { display: none; } /* keep header lean on phone */
  .lang-switch button { padding: 8px 11px; min-width: 38px; }
  .menu-toggle { padding: 10px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 19px; }
  .brand-mark { width: 32px; height: 32px; font-size: 17px; }
}

/* Cards: keep readable on phone */
@media (max-width: 480px) {
  .card { padding: 24px 22px; min-height: 0; }
  .card h3 { font-size: 22px; }
}

/* Full-width buttons on mobile by default for primary CTAs */
@media (max-width: 480px) {
  .form-page .btn[type="submit"] { width: 100%; justify-content: center; }
  .meeting-section .btn-meeting { width: 100%; justify-content: center; }
}

/* Detail page — avatar/author block improvements on mobile */
@media (max-width: 600px) {
  .detail-main h1 { font-size: clamp(28px, 7vw, 36px); }
  .detail-author { font-size: 17px; }
  .detail-description { font-size: 16px; }
}

/* Keep Jitsi note readable */
.meeting-section.compact {
  padding: 22px 24px;
  margin: 22px 0;
}

/* Make sure dynamic content has a min-height to prevent layout shift */
#results-grid:empty,
#featured-grid:empty {
  min-height: 200px;
}

/* =========================================================
   v3 ADDITIONS: auth widget, profile, forum, chat, admin,
                 ratings, slots, bookings
   ========================================================= */

/* ---------- User widget ---------- */
.user-widget { display:flex; align-items:center; gap:8px; }
.user-widget .btn-link {
  color: var(--ink); font-weight: 600; text-decoration: none;
  padding: 6px 10px;
}
.user-widget .btn-link:hover { color: var(--accent); }
.btn-small {
  padding: 6px 12px !important; font-size: 14px !important;
}
.user-menu { position: relative; }
.user-menu-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: 32px;
  cursor: pointer; user-select: none;
  background: rgba(0,0,0,0.04);
  border: 0; font: inherit; color: inherit;
}
.user-menu-toggle:hover { background: rgba(0,0,0,0.08); }
.user-menu-name { font-weight: 600; font-size: 14px; }
.user-menu-dropdown {
  display: none;
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--bg-card, #fff); border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 200px; padding: 8px; z-index: 1000;
  flex-direction: column;
}
.user-menu.open .user-menu-dropdown { display: flex; }
.user-menu-dropdown a, .user-menu-dropdown button {
  display: block; padding: 10px 14px; text-decoration: none;
  color: var(--ink); border: 0; background: transparent;
  text-align: left; cursor: pointer; border-radius: 8px;
  font: inherit; width: 100%;
}
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover {
  background: rgba(0,0,0,0.05);
}

@media (max-width: 760px) {
  .user-widget { order: 3; margin-left: auto; }
  .user-menu-name { display: none; }
}

/* ---------- Avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700;
  flex-shrink: 0; line-height: 1;
}

/* ---------- Star ratings ---------- */
.star-rating {
  display: inline-flex; gap: 1px; vertical-align: middle;
}
.star-rating .star-on { fill: #d4a900; }
.star-rating .star-off { fill: #ddd; }
.rating-block {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px; color: var(--ink-muted);
  font-size: 14px;
}
.chip-rating { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--bg-card, #fff); padding: 24px; border-radius: 14px;
  box-shadow: 0 2px 18px rgba(0,0,0,0.06);
}
.form-error {
  color: #c0392b; padding: 10px 14px; margin-bottom: 14px;
  background: rgba(192,57,43,0.08); border-radius: 8px;
  display: none;
}
.form-error:not(:empty) { display: block; }
.form-success {
  color: #27734a; padding: 10px 14px; margin-bottom: 14px;
  background: rgba(39,115,74,0.1); border-radius: 8px;
  display: none;
}

/* ---------- Profile tabs ---------- */
.profile-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 30px;
}
.profile-tabs .tab {
  background: transparent; border: 0; padding: 12px 18px;
  font: inherit; font-weight: 600; color: var(--ink-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.profile-tabs .tab:hover { color: var(--ink); }
.profile-tabs .tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.tab-content { display: block; }
.tab-content[hidden] { display: none; }

.profile-card {
  background: var(--bg-card, #fff); padding: 24px;
  border-radius: 14px; box-shadow: 0 2px 18px rgba(0,0,0,0.06);
  margin-bottom: 30px;
}
.profile-card-head {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 12px;
}
.profile-card-head h1, .profile-card-head h2 { margin: 0 0 4px; }
.profile-card .bio { margin-top: 16px; }

.offer-card-mini {
  display: block; padding: 14px 18px;
  background: var(--bg-card, #fff); border-radius: 10px;
  text-decoration: none; color: var(--ink);
  margin-bottom: 10px; border-left: 3px solid var(--ink-muted);
  transition: transform .15s;
}
.offer-card-mini:hover { transform: translateX(4px); }
.offer-card-mini.card-offer { border-left-color: #a83b2a; }
.offer-card-mini.card-request { border-left-color: #5e6b4a; }
.offer-card-mini strong { display: block; margin-bottom: 4px; }

/* ---------- Booking cards ---------- */
.booking-card {
  background: var(--bg-card, #fff); padding: 18px;
  border-radius: 12px; margin-bottom: 14px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.05);
  border-left: 4px solid var(--ink-muted);
}
.booking-card.status-pending   { border-left-color: #d4a900; }
.booking-card.status-confirmed { border-left-color: #2980b9; }
.booking-card.status-completed { border-left-color: #27ae60; }
.booking-card.status-cancelled { border-left-color: #95a5a6; opacity: 0.7; }
.booking-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  background: rgba(0,0,0,0.06); font-size: 12px; font-weight: 600;
}
.booking-message {
  font-style: italic; color: var(--ink-muted);
  background: rgba(0,0,0,0.03); padding: 8px 12px; border-radius: 8px;
}
.booking-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}

/* ---------- Slots ---------- */
.slots-block { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.08); }
.slot-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.slot-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding: 14px 18px; background: var(--bg-card, #fff);
  border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.slot-time { flex: 1; min-width: 200px; }
.slot-notes { font-size: 14px; color: var(--ink-muted); margin-top: 4px; }

/* ---------- Reviews ---------- */
.review-card {
  background: var(--bg-card, #fff); padding: 16px 20px;
  border-radius: 10px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.review-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.review-head a {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
}

/* ---------- Forum ---------- */
.forum-cats { display: flex; flex-direction: column; gap: 18px; }
.forum-cat {
  background: var(--bg-card, #fff); padding: 22px;
  border-radius: 14px; box-shadow: 0 2px 18px rgba(0,0,0,0.06);
}
.forum-cat h3 { margin: 0 0 4px; }
.forum-cat-threads { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.forum-thread-link {
  display: block; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--ink);
}
.forum-thread-link:hover { background: rgba(0,0,0,0.04); }
.forum-thread-link strong { display: block; }
.forum-thread-link .hint { display: block; font-size: 13px; }

.forum-posts { display: flex; flex-direction: column; gap: 16px; }
.forum-post {
  background: var(--bg-card, #fff); padding: 20px;
  border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.forum-post-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.forum-post-head a { color: var(--ink); text-decoration: none; }
.forum-post-head a:hover { color: var(--accent); }
.forum-post-body { line-height: 1.65; }

/* ---------- Chat ---------- */
.chat-main {
  height: calc(100vh - 80px);
  padding: 0;
}
.chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100%;
  background: var(--bg-card, #fff);
}
.chat-sidebar {
  border-right: 1px solid rgba(0,0,0,0.08);
  overflow-y: auto;
}
.chat-sidebar-head {
  padding: 18px 22px; border-bottom: 1px solid rgba(0,0,0,0.08);
  position: sticky; top: 0; background: var(--bg-card, #fff);
}
.chat-sidebar-head h2 { margin: 0; }
.chat-conv {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  position: relative;
}
.chat-conv:hover { background: rgba(0,0,0,0.03); }
.chat-conv.has-unread { background: rgba(212, 169, 0, 0.08); }
.chat-conv-meta { flex: 1; min-width: 0; }
.chat-conv-meta strong { display: block; }
.chat-conv-meta p {
  margin: 2px 0 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.chat-conv .badge {
  background: #c0392b; color: #fff;
  border-radius: 99px; padding: 2px 8px;
  font-size: 12px; font-weight: 700;
}

.chat-active { display: flex; flex-direction: column; height: 100%; }
.chat-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px; text-align: center; color: var(--ink-muted);
}
.chat-head {
  padding: 14px 22px; border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; background: var(--bg-card, #fff);
}
.chat-back {
  background: transparent; border: 0; font-size: 24px;
  cursor: pointer; padding: 4px 10px; display: none;
}
.chat-partner-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 18px 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg { max-width: 75%; }
.chat-msg.mine { align-self: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.chat-msg-body {
  padding: 10px 14px; border-radius: 14px;
  background: rgba(0,0,0,0.06);
  word-wrap: break-word;
}
.chat-msg.mine .chat-msg-body {
  background: var(--accent); color: #fff;
}
.chat-msg-time {
  font-size: 11px; color: var(--ink-muted); margin-top: 2px;
  text-align: right;
}
.chat-msg.theirs .chat-msg-time { text-align: left; }
.chat-form {
  display: flex; gap: 8px; padding: 12px 18px;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: var(--bg-card, #fff);
}
.chat-form textarea {
  flex: 1; resize: none; padding: 10px 14px;
  border-radius: 12px; border: 1px solid rgba(0,0,0,0.1);
  font: inherit;
}
.chat-form button { align-self: flex-end; }

@media (max-width: 760px) {
  .chat-shell { grid-template-columns: 1fr; }
  .chat-sidebar { display: block; }
  .chat-active { display: none; }
  .chat-back { display: block; }
  .chat-sidebar.mobile-hidden { display: none; }
  .chat-active.mobile-shown { display: flex; }
}

/* ---------- Admin ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 30px;
}
.stat-card {
  background: var(--bg-card, #fff); padding: 20px;
  border-radius: 12px; box-shadow: 0 2px 14px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card span { color: var(--ink-muted); font-size: 14px; }
.stat-card strong { font-size: 32px; font-family: var(--font-display, serif); }

.admin-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  background: var(--bg-card, #fff); border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 14px rgba(0,0,0,0.05);
}
.admin-table th, .admin-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.admin-table thead { background: rgba(0,0,0,0.04); }
.admin-table tr.is-banned, .admin-table tr.is-hidden { opacity: 0.5; }
.admin-table .hint { font-size: 12px; }
.admin-table td a { color: var(--accent); text-decoration: none; }

.msg-log { display: flex; flex-direction: column; gap: 12px; }
.msg-row {
  background: var(--bg-card, #fff); padding: 16px 20px;
  border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.msg-meta { font-size: 14px; }
.msg-offer { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.msg-body { margin: 8px 0 0; }

.hint.ok { color: #27734a; }
.hint.err { color: #c0392b; }

@media (max-width: 760px) {
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 8px; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { margin-bottom: 12px; padding: 12px; }
  .admin-table td { border: 0; padding: 4px 0; }
}

/* =========================================================
   v3.1 ADDITIONS: forum upgrade + migrations
   ========================================================= */

/* ---------- Forum index — richer category cards ---------- */
.forum-toolbar { margin-bottom: 28px; }
.forum-cat {
  border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 2px 18px rgba(0,0,0,0.05);
}
.forum-cat-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 4px;
}
.forum-cat-head h3 { margin: 0; }
.forum-cat-count {
  font-size: 13px; color: var(--ink-muted);
  background: rgba(0,0,0,0.06); padding: 3px 10px; border-radius: 99px;
}

/* ---------- Forum thread page — markdown body ---------- */
.forum-post-body { line-height: 1.65; }
.forum-post-body p { margin: 0.6em 0; }
.forum-post-body p:first-child { margin-top: 0; }
.forum-post-body p:last-child { margin-bottom: 0; }
.forum-post-body h3, .forum-post-body h4 { margin: 1em 0 0.4em; }
.forum-post-body code {
  background: rgba(0,0,0,0.06); padding: 1px 6px;
  border-radius: 4px; font-size: 0.9em; font-family: ui-monospace, monospace;
}
.forum-post-body blockquote {
  margin: 0.6em 0; padding: 8px 14px;
  border-left: 3px solid rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.03);
  color: var(--ink-muted);
}
.forum-post-body ul { margin: 0.5em 0; padding-left: 24px; }
.forum-post-body a.mention {
  background: rgba(168,59,42,0.1); padding: 1px 6px;
  border-radius: 4px; text-decoration: none;
  color: var(--paprika, #a83b2a); font-weight: 600;
}

/* Post header layout: avatar | meta | modify */
.forum-post-head { gap: 12px; }
.forum-post-meta { flex: 1; }
.forum-post-modify {
  display: flex; gap: 8px; align-items: center;
}
.role-pill {
  display: inline-block; padding: 1px 8px;
  background: rgba(168,59,42,0.15); color: var(--paprika, #a83b2a);
  border-radius: 99px; font-size: 11px; font-weight: 700; margin-left: 6px;
  vertical-align: middle;
}

/* Post foot: reactions + quote */
.forum-post-foot {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-top: 14px;
  padding-top: 12px; border-top: 1px dashed rgba(0,0,0,0.08);
}
.forum-reactions { display: flex; gap: 6px; }
.react-btn {
  background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.08);
  border-radius: 99px; padding: 4px 10px;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; font: inherit; font-size: 14px;
  transition: all .15s;
}
.react-btn:hover:not(:disabled) {
  background: rgba(168,59,42,0.08); border-color: rgba(168,59,42,0.25);
}
.react-btn.mine {
  background: rgba(168,59,42,0.15); border-color: rgba(168,59,42,0.4);
}
.react-btn:disabled { opacity: 0.5; cursor: default; }
.react-emoji { font-size: 16px; line-height: 1; }
.react-count { font-weight: 600; min-width: 12px; }

.link-btn {
  background: transparent; border: 0; color: var(--ink-muted);
  cursor: pointer; font: inherit; font-size: 14px;
  padding: 2px 6px; text-decoration: underline;
}
.link-btn:hover { color: var(--ink); }
.link-btn.link-danger:hover { color: #c0392b; }

/* ---------- Markdown toolbar ---------- */
.md-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  align-items: center;
}
.md-toolbar button {
  background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font: inherit; min-width: 32px;
}
.md-toolbar button:hover { background: rgba(0,0,0,0.08); }
.md-help {
  margin-left: auto; font-size: 12px; color: var(--ink-muted);
}

.forum-reply textarea {
  font-family: ui-monospace, "Cascadia Mono", "Source Code Pro", monospace;
  font-size: 14px; line-height: 1.5;
}

/* ---------- Migrations table ---------- */
tr.is-pending td { background: rgba(212,169,0,0.06); }
.admin-table code {
  background: rgba(0,0,0,0.06); padding: 1px 6px;
  border-radius: 4px; font-size: 13px;
}

