/* =====================================================================
   WinWinLogic — warm social community board.
   DM Sans (body) + Fraunces italic (accents). Cream + sunrise orange.
   ===================================================================== */

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

:root {
  /* ---- Surface ---- */
  --bg:         #fdf9f1;
  --bg-soft:    #f6eed9;
  --surface:    #ffffff;
  --surface-2:  #fbf5e8;

  /* ---- Ink ---- */
  --ink:        #1f1d1a;
  --ink-2:      #3a342b;
  --ink-3:      #5a5244;
  --muted:      #8a8172;
  --muted-2:    #b3a893;

  /* ---- Lines ---- */
  --border:     #ece3ce;
  --border-2:   #dccfae;

  /* ---- Accent: sunrise orange ---- */
  --accent:      #e85d2c;
  --accent-dark: #c14a1d;
  --accent-soft: #fde4d4;
  --accent-glow: rgba(232, 93, 44, 0.18);

  /* ---- Supporting ---- */
  --success:    #3f8554;
  --success-soft:#dcecdf;
  --warn:       #b7801e;
  --warn-soft:  #fbecc2;
  --info:       #3a6a9a;
  --info-soft:  #dce7f0;

  /* ---- Avatar palette (deterministic) ---- */
  --a1: #e85d2c;  --a2: #3a6a9a;  --a3: #b7801e;
  --a4: #3f8554;  --a5: #a13c7a;  --a6: #5e4caf;
  --a7: #2d7a8c;  --a8: #c9473d;

  /* ---- Type ---- */
  --font:         'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: 'Fraunces', 'DM Sans', Georgia, serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- Space ---- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;
  --s-4: 16px;  --s-5: 20px;  --s-6: 28px;
  --s-7: 40px;  --s-8: 64px;

  /* ---- Radius ---- */
  --r-1: 6px;   --r-2: 10px;  --r-3: 14px;
  --r-4: 20px;  --r-pill: 999px;

  /* ---- Shadow ---- */
  --shadow-1: 0 1px 2px rgba(31, 29, 26, 0.04), 0 1px 1px rgba(31, 29, 26, 0.03);
  --shadow-2: 0 4px 12px -2px rgba(31, 29, 26, 0.06), 0 2px 6px -1px rgba(31, 29, 26, 0.04);
  --shadow-3: 0 12px 32px -12px rgba(31, 29, 26, 0.22), 0 4px 12px -4px rgba(31, 29, 26, 0.1);
  --shadow-accent: 0 4px 14px -4px var(--accent-glow);

  /* ---- Layout ---- */
  --w-max:    1240px;
  --h-nav:    60px;
}

/* =========== Reset =========== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-dark); }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-1); }

/* =========== Container =========== */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: 24px;
}
@media (max-width: 640px) { .container { padding-inline: 16px; } }

/* =========== Top nav =========== */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(8px);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: var(--h-nav);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: none;
}
.logo:hover { color: var(--ink); }
.logo__mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 16px;
  line-height: 1;
  box-shadow: var(--shadow-accent);
}
.logo__name em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  padding-inline: 1px;
}

.nav__search {
  flex: 1;
  max-width: 440px;
  position: relative;
  margin-inline: var(--s-4);
}
.nav__search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.nav__search input:hover { border-color: var(--border-2); }
.nav__search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-glow); }
.nav__search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
  flex: none;
}

/* Primary button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-2);
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: white; transform: translateY(-1px); }
.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--border-2); background: var(--surface-2); }
.btn--quiet { padding: 6px 10px; color: var(--ink-2); font-weight: 500; }
.btn--quiet:hover { color: var(--accent); }
.btn--sm { padding: 6px 10px; font-size: 0.82rem; }
.btn--block { width: 100%; justify-content: center; }

/* Account dropdown menu */
.account-menu {
  position: absolute;
  top: calc(var(--h-nav) - 6px);
  right: 24px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-3);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.account-menu[hidden] { display: none; }
.account-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--ink);
  border-radius: var(--r-1);
  text-decoration: none;
}
.account-menu a:hover { background: var(--surface-2); color: var(--accent); }
.account-menu a[data-logout] { color: var(--warn); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; border-radius: 0 0 var(--r-1) var(--r-1); }

/* Notification bell */
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-2);
  color: var(--ink-2);
  background: transparent;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn__dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

/* Account dropdown trigger */
.account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 3px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.account:hover { border-color: var(--border-2); box-shadow: var(--shadow-1); }
.account svg { width: 14px; height: 14px; color: var(--muted); }

/* =========== Avatars =========== */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  flex: none;
  font-feature-settings: "ss01" 1;
  letter-spacing: 0;
  text-transform: uppercase;
  line-height: 1;
}
.avatar--xs { width: 20px; height: 20px; font-size: 0.66rem; }
.avatar--sm { width: 28px; height: 28px; font-size: 0.74rem; }
.avatar--lg { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar--a1 { background: var(--a1); }
.avatar--a2 { background: var(--a2); }
.avatar--a3 { background: var(--a3); }
.avatar--a4 { background: var(--a4); }
.avatar--a5 { background: var(--a5); }
.avatar--a6 { background: var(--a6); }
.avatar--a7 { background: var(--a7); }
.avatar--a8 { background: var(--a8); }

/* =========== Welcome strip =========== */
.welcome {
  padding-block: var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.welcome__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.welcome__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
}
.welcome__title em { font-style: italic; color: var(--accent); }
.welcome__sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}
.welcome__pulse {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--success-soft);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
}
.welcome__pulse::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--success);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 133, 84, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(63, 133, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 133, 84, 0); }
}

/* =========== Filter bar =========== */
.filters {
  padding-block: var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.pill:hover { border-color: var(--border-2); background: var(--surface-2); }
.pill.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.pill__icon { font-size: 0.95rem; line-height: 1; }
.filters__spacer { flex: 1; }
.filters__label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}

/* =========== Page grid =========== */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s-7);
  padding-block: var(--s-5) var(--s-7);
}
@media (max-width: 980px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .sidebar { order: -1; }
}

/* =========== Feed =========== */
.feed { display: flex; flex-direction: column; gap: var(--s-4); }

/* =========== Post card =========== */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4) var(--s-5) var(--s-3);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post:hover { border-color: var(--border-2); box-shadow: var(--shadow-2); }
.post.is-expired { opacity: 0.6; }

.post__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}
.post__user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.post__name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.3;
}
.post__name .muted { color: var(--muted); font-weight: 400; }
.post__meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post__meta .sep {
  width: 3px; height: 3px;
  background: var(--muted-2);
  border-radius: 50%;
}

/* Type/scope chip on post head */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip--deal     { background: #fdece3; color: #a3401a; border-color: #f6d2bd; }
.chip--event    { background: #fce6f0; color: #9d2d5b; border-color: #f4c7db; }
.chip--digital  { background: #dceae2; color: #28624a; border-color: #c0d9cd; }
.chip--freebie  { background: var(--warn-soft); color: var(--warn); border-color: #ecd99a; }
.chip--global   { background: #e2eaf0; color: #375779; border-color: #c4d3e0; }
.chip--country  { background: #ece7f6; color: #4b358b; border-color: #d4c7ea; }
.chip--city     { background: var(--accent-soft); color: var(--accent-dark); border-color: #f4c6ac; }

.post__menu {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--muted);
  display: grid; place-items: center;
  transition: background 0.15s;
}
.post__menu:hover { background: var(--surface-2); color: var(--ink); }

/* Post body */
.post__title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.post__title a { color: inherit; }
.post__title a:hover { color: var(--accent); }

.post__desc {
  color: var(--ink-3);
  font-size: 0.94rem;
  margin: 0 0 var(--s-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* Link preview card */
.link-preview {
  display: flex;
  align-items: stretch;
  gap: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 10px 12px;
  margin-bottom: var(--s-3);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.link-preview:hover { border-color: var(--border-2); background: var(--surface); }
.link-preview__thumb {
  flex: none;
  width: 48px; height: 48px;
  border-radius: var(--r-1);
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  background: linear-gradient(135deg, var(--a1), var(--a5));
}
.link-preview--edx    .link-preview__thumb { background: linear-gradient(135deg, #c52127, #8b1317); }
.link-preview--humble .link-preview__thumb { background: linear-gradient(135deg, #cc2929, #a61d1d); }
.link-preview--renfe  .link-preview__thumb { background: linear-gradient(135deg, #6c1b76, #3c0f47); }
.link-preview--ableton .link-preview__thumb{ background: linear-gradient(135deg, #1f1f1f, #444); }
.link-preview--gutenberg .link-preview__thumb { background: linear-gradient(135deg, #6c4420, #3b2410); }

.link-preview__body { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.link-preview__domain {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 2px;
}
.link-preview__title {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.link-preview__external {
  margin-left: auto;
  color: var(--muted);
  display: flex; align-items: center;
}
.link-preview__external svg { width: 14px; height: 14px; }

/* Reactions row */
.reactions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  color: var(--ink-2);
  transition: all 0.15s;
  font-weight: 500;
  cursor: pointer;
}
.react:hover { border-color: var(--border-2); background: var(--surface); transform: translateY(-1px); }
.react.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.react__emoji { font-size: 0.98rem; line-height: 1; }
.react__count { font-variant-numeric: tabular-nums; font-weight: 600; }

.react--confirm {
  background: var(--success-soft);
  border-color: #bfd8c5;
  color: var(--success);
}
.react--confirm:hover { background: var(--success-soft); }
.react--confirm.is-active { background: var(--success); color: white; border-color: var(--success); }

.post__actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.post__action {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.post__action:hover { color: var(--ink); background: var(--surface-2); }
.post__action.is-active { color: var(--accent); }
.post__action svg { width: 14px; height: 14px; }

/* Comments preview */
.comments-preview {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--border-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comments-preview__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.45;
}
.comments-preview__row .avatar { margin-top: 1px; }
.comments-preview__row b { font-weight: 600; color: var(--ink); margin-right: 6px; }
.comments-preview__row span { color: var(--ink-2); }
.comments-preview__more {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.comments-preview__more:hover { color: var(--accent); }
.comments-preview__input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}
.comments-preview__input input {
  flex: 1;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.86rem;
  color: var(--ink);
}
.comments-preview__input input::placeholder { color: var(--muted); }
.comments-preview__input input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* =========== Sidebar =========== */
.sidebar { display: flex; flex-direction: column; gap: var(--s-4); position: sticky; top: calc(var(--h-nav) + var(--s-4)); align-self: start; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
}
.panel__head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--s-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel__head small {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

/* User panel */
.me {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-3);
}
.me__info { min-width: 0; }
.me__name { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.me__handle { font-size: 0.82rem; color: var(--muted); }
.me__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: var(--s-3);
}
.me__stat {
  padding: 8px 4px;
  background: var(--surface-2);
  border-radius: var(--r-1);
}
.me__stat:first-child { border-top-left-radius: var(--r-2); border-bottom-left-radius: var(--r-2); }
.me__stat:last-child  { border-top-right-radius: var(--r-2); border-bottom-right-radius: var(--r-2); }
.me__stat-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1.1;
}
.me__stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.karma {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: var(--r-2);
  font-size: 0.84rem;
  color: var(--accent-dark);
  font-weight: 500;
}
.karma strong { font-weight: 700; }
.karma svg { width: 14px; height: 14px; }

/* Pulse widget */
.live-now {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--success-soft);
  border-radius: var(--r-2);
  font-size: 0.84rem;
  color: var(--success);
  margin-bottom: var(--s-2);
}
.live-now::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2.2s ease-out infinite;
  flex: none;
}
.live-now strong { font-weight: 700; margin-right: 3px; }

/* Trending list */
.trend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trend li {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
}
.trend__rank {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-style: italic;
}
.trend__title {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trend__title a { color: inherit; }
.trend__title a:hover { color: var(--accent); }
.trend__meta { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Cities */
.cities { display: flex; flex-direction: column; gap: 2px; }
.cities a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  margin-inline: -10px;
  border-radius: var(--r-2);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 500;
}
.cities a:hover { background: var(--surface-2); color: var(--ink); }
.cities .city-name { display: flex; align-items: center; gap: 8px; }
.cities .count { color: var(--muted); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.cities .flag {
  width: 18px; height: 14px;
  border-radius: 2px;
  background: var(--border);
  display: inline-block;
  font-size: 0.8rem;
  line-height: 14px;
  text-align: center;
}

/* CTA panel */
.cta {
  padding: var(--s-4);
  background: linear-gradient(135deg, var(--accent) 0%, #e57c2c 100%);
  color: white;
  border-radius: var(--r-3);
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: '';
  position: absolute;
  right: -20px; top: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.cta h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.cta h3 em { font-style: italic; font-weight: 400; }
.cta p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.9);
  margin: 0 0 var(--s-3);
  line-height: 1.45;
}
.cta .btn {
  background: white;
  color: var(--accent);
  border-color: white;
  font-weight: 700;
}
.cta .btn:hover { background: var(--ink); color: white; border-color: var(--ink); }

/* =========== Footer =========== */
.foot {
  border-top: 1px solid var(--border);
  padding-block: var(--s-5);
  font-size: 0.82rem;
  color: var(--muted);
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
}
.foot a { color: var(--ink-3); }
.foot a:hover { color: var(--accent); }
.foot__right { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }

/* =========== Profile =========== */
.profile-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-5);
  align-items: start;
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 540px) {
  .profile-head { grid-template-columns: 1fr; text-align: center; }
  .profile-head > .avatar { margin-inline: auto; }
}
.profile-head__info { min-width: 0; }
.profile-head__name-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: var(--s-5);
  border-radius: var(--r-2);
  overflow: hidden;
}
.profile-stats .me__stat {
  padding: var(--s-4);
  background: var(--surface-2);
  border-radius: 0;
}
.profile-stats .me__stat:first-child { border-top-left-radius: var(--r-2); border-bottom-left-radius: var(--r-2); }
.profile-stats .me__stat:last-child  { border-top-right-radius: var(--r-2); border-bottom-right-radius: var(--r-2); }
.profile-stats .me__stat-num { font-size: 1.4rem; }

.profile-tabs {
  display: flex;
  gap: 4px;
  margin-top: var(--s-6);
  border-bottom: 1px solid var(--border);
}
.profile-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.profile-tab:hover { color: var(--ink); }
.profile-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.profile-tab__content { margin-top: var(--s-4); }

.profile-comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  margin-bottom: 8px;
}

.comments-list { display: flex; flex-direction: column; gap: 8px; }

/* Profile edit modal */
.profile-editor {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, 0.45);
  display: grid;
  place-items: center;
  padding: var(--s-4);
  z-index: 90;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.profile-editor__card {
  background: var(--surface);
  border-radius: var(--r-3);
  padding: var(--s-5);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-3);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

/* =========== Comments =========== */
.comment { transition: background 0.12s; }
.comment:hover { background: var(--surface-2); border-radius: var(--r-1); }
.comment:last-child { border-bottom: none !important; }

/* =========== Related row =========== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
}
.related-card {
  display: block;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.08s, box-shadow 0.15s;
}
.related-card:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
  color: var(--accent-dark);
}
.related-card__title {
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Comments preview on feed cards */
.comments-preview {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--border-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
}
.comments-preview__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.45;
}
.comments-preview__row .avatar { margin-top: 1px; }
.comments-preview__row b { font-weight: 600; color: var(--ink); margin-right: 6px; }
.comments-preview__row span { color: var(--ink-2); }
.comments-preview__more {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.comments-preview__more:hover { color: var(--accent); }

/* =========== Toast =========== */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  background: var(--ink);
  color: white;
  border-radius: var(--r-pill);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast--show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* =========== Reaction picker (popover) =========== */
.react-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-3);
  z-index: 20;
  white-space: nowrap;
}
.react-picker__btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; background: transparent;
  font-size: 1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
}
.react-picker__btn:hover { background: var(--surface-2); transform: scale(1.2); }

/* Add reaction button (the "+" trigger) */
.react-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  padding: 0;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transition: all 0.15s;
  position: relative;
}
.react-add:hover { border-style: solid; border-color: var(--accent); color: var(--accent); }

/* =========== Responsive =========== */
@media (max-width: 760px) {
  .nav__search { display: none; }
  .account__name { display: none; }
  .welcome__pulse { margin-left: 0; width: 100%; justify-content: center; }
  .filters__spacer { display: none; }
  .post { padding: var(--s-3) var(--s-4); }

  /* Filter row: horizontal scroll instead of wrapping — cleaner on narrow screens */
  .filters > .container {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .filters > .container::-webkit-scrollbar { display: none; }
  .filters .pill { flex: none; }

  /* Min 40px tap targets on mobile */
  .pill, .react, .action-btn, .post__action { min-height: 36px; }
  .btn { min-height: 40px; padding-block: 10px; }
  .icon-btn, .vote__btn { min-width: 40px; min-height: 40px; }
}

/* =========== Forms (post page scaffolding) =========== */
.form {
  display: flex; flex-direction: column; gap: var(--s-4);
  max-width: 620px; margin-inline: auto;
  padding: var(--s-6) 0;
}
.form__h {
  font-family: var(--font-display); font-weight: 500; font-size: 2rem; line-height: 1.1;
  margin: 0 0 var(--s-2); letter-spacing: -0.02em;
}
.form__h em { font-style: italic; color: var(--accent); }
.form__hint { font-size: 0.88rem; color: var(--muted); }
.form__field { display: flex; flex-direction: column; gap: 6px; }
.form__label { font-size: 0.86rem; font-weight: 600; }
.form__input, .form__textarea, .form__select {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-2);
}
.form__input:focus, .form__textarea:focus, .form__select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.form__textarea { min-height: 120px; resize: vertical; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 540px) { .form__grid { grid-template-columns: 1fr; } }

/* =========== State =========== */
.state { padding: var(--s-7) var(--s-5); text-align: center; color: var(--muted); }
.state h2 { color: var(--ink); font-size: 1.2rem; margin: 0 0 4px; font-weight: 600; }

/* =========== Utilities =========== */
.muted { color: var(--muted); }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }
