/* =========================================================
   PINTENSE — Main Stylesheet
   Pastel social platform with pin-note aesthetics
   ========================================================= */

/* Google Fonts loaded via functions.php */

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --cream:      #FFF8F2;
  --peach-light:#FDE8D8;
  --peach:      #F4C4A8;
  --rose-light: #FDDCE4;
  --rose:       #F4A8B8;
  --sage-light: #D8EDE6;
  --sage:       #A8D4C4;
  --sky-light:  #DCE8F8;
  --sky:        #A8C4E8;
  --lemon-light:#FEF5D0;
  --lemon:      #F8E490;
  --lavender-light:#EAE0FC;
  --lavender:   #C8B4F0;
  --mint-light: #DCFAEE;
  --mint:       #A0E8C8;

  --note-yellow:  #FEF3A0;
  --note-pink:    #FFD6E0;
  --note-mint:    #C8F0E0;
  --note-blue:    #C8E4FF;
  --note-peach:   #FFE4C8;
  --note-lilac:   #E8D8FF;
  --note-lemon:   #FEF0A0;
  --note-white:   #F8F8F4;

  --pin-red:    #D64040;
  --pin-gold:   #C4860A;
  --pin-navy:   #1E3A5F;
  --pin-forest: #1A5C35;
  --pin-plum:   #6B2D6B;
  --pin-slate:  #4A5568;

  --text:       #3D2820;
  --text-mid:   #7A5C52;
  --text-light: #B09080;
  --accent:     #E07060;
  --accent-dark:#B85540;
  --border:     #EDD8CC;
  --surface:    #FFFAF6;

  --shadow-sm:  0 2px 8px rgba(61,40,32,0.08);
  --shadow-md:  0 4px 20px rgba(61,40,32,0.12);
  --shadow-pin: 2px 5px 18px rgba(61,40,32,0.18), 0 1px 3px rgba(61,40,32,0.1);
  --shadow-card:0 2px 12px rgba(61,40,32,0.1);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill:100px;

  --font-hand:  'Caveat', cursive;
  --font-ui:    'DM Sans', sans-serif;

  --nav-h:      64px;
}

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-ui); }
input, select, textarea { font-family: var(--font-ui); }

/* ─── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--peach-light); }
::-webkit-scrollbar-thumb { background: var(--peach); border-radius: 3px; }

/* ─── Typography ─────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-weight: 500; line-height: 1.2; }
.font-hand { font-family: var(--font-hand); }

/* =========================================================
   NAV
   ========================================================= */
.pintense-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,248,242,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
}

.nav-logo {
  font-family: var(--font-hand);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-pin-icon {
  width: 18px; height: 18px;
  background: var(--pin-red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  flex-shrink: 0;
  position: relative;
}
.nav-pin-icon::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  top: 3px; left: 3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-mid);
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--peach-light); color: var(--text); }
.nav-link.active { background: var(--peach-light); color: var(--accent); font-weight: 500; }
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-notif-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: none;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid);
  transition: all 0.18s;
  position: relative;
}
.nav-notif-btn:hover { background: var(--peach-light); border-color: var(--peach); }
.nav-notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--cream);
}

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--peach);
  cursor: pointer;
  transition: border-color 0.18s;
}
.nav-avatar:hover { border-color: var(--accent); }

.nav-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--peach-light);
  border: 2px solid var(--peach);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hand);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-nav-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.18s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* User dropdown */
.nav-user-menu {
  position: relative;
}
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: 6px;
  display: none;
  z-index: 300;
}
.nav-user-dropdown.open { display: block; }
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-mid);
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--peach-light); color: var(--text); }
.nav-dropdown-item.danger:hover { background: #FFE8E8; color: var(--pin-red); }
.nav-dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* =========================================================
   PAGE WRAPPER (logged-in pages)
   ========================================================= */
.page-body { padding-top: var(--nav-h); min-height: 100vh; }

.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  gap: 24px;
  align-items: start;
}
.page-layout.single-col { grid-template-columns: 1fr; max-width: 700px; }
.page-layout.two-col { grid-template-columns: 240px 1fr; }

/* ─── Sidebar ─────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.sidebar-user-info {
  text-align: center;
  padding: 20px 16px;
}
.sidebar-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--peach);
  margin: 0 auto 10px;
  display: block;
}
.sidebar-avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--peach-light);
  border: 3px solid var(--peach);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hand);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 10px;
}
.sidebar-username { font-weight: 500; font-size: 16px; }
.sidebar-handle { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.sidebar-stat {
  text-align: center;
  background: var(--peach-light);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
}
.sidebar-stat-num { font-family: var(--font-hand); font-size: 22px; font-weight: 700; color: var(--accent); }
.sidebar-stat-label { font-size: 11px; color: var(--text-light); }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-mid);
  transition: all 0.15s;
}
.sidebar-nav-link:hover { background: var(--peach-light); color: var(--text); }
.sidebar-nav-link.active { background: var(--peach-light); color: var(--accent); font-weight: 500; }
.sidebar-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── Right Sidebar ─────────────────────────────────────── */
.sidebar-right { position: sticky; top: calc(var(--nav-h) + 24px); }
.widget-title { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); margin-bottom: 12px; }

/* =========================================================
   PIN CARD
   ========================================================= */
.pin-card {
  position: relative;
  border-radius: 2px;
  padding: 24px 20px 16px;
  box-shadow: var(--shadow-pin);
  margin-bottom: 28px;
  transform: rotate(var(--card-rotation, -0.5deg));
  transition: transform 0.2s, box-shadow 0.2s;
  animation: pinDrop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: var(--anim-delay, 0s);
}
.pin-card:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 4px 8px 28px rgba(61,40,32,0.2);
}

@keyframes pinDrop {
  from { opacity: 0; transform: rotate(var(--card-rotation,-0.5deg)) translateY(-20px); }
  to   { opacity: 1; transform: rotate(var(--card-rotation,-0.5deg)) translateY(0); }
}

/* The pin head */
.pin-head {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 22px; height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: translateX(-50%) rotate(-45deg);
  box-shadow: 1px 2px 8px rgba(0,0,0,0.25);
  z-index: 2;
  transition: transform 0.2s;
}
.pin-head::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  top: 4px; left: 4px;
}
.pin-card:hover .pin-head { transform: translateX(-50%) rotate(-45deg) scale(1.1); }

/* Pin tape effect at top */
.pin-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px 2px 0 0;
}

.pin-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.pin-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.pin-user-avatar-ph {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hand);
  font-size: 14px;
  font-weight: 700;
  color: rgba(61,40,32,0.6);
  flex-shrink: 0;
}
.pin-username {
  font-size: 13px;
  font-weight: 500;
  color: rgba(61,40,32,0.65);
}
.pin-time {
  font-size: 11px;
  color: rgba(61,40,32,0.4);
  margin-left: auto;
}

.pin-content {
  font-family: var(--font-hand);
  font-size: 19px;
  line-height: 1.55;
  color: rgba(61,40,32,0.82);
  word-break: break-word;
  min-height: 40px;
}
.pin-drawn-canvas {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.pin-media {
  margin-top: 10px;
  border-radius: 6px;
  overflow: hidden;
}
.pin-media img, .pin-media video {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.pin-map {
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid rgba(61,40,32,0.1);
}

.pin-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(61,40,32,0.08);
}
.pin-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: rgba(61,40,32,0.5);
  background: none;
  border: none;
  transition: all 0.15s;
}
.pin-action-btn:hover { background: rgba(61,40,32,0.07); color: rgba(61,40,32,0.8); }
.pin-action-btn.liked { color: var(--pin-red); }
.pin-action-btn svg { width: 14px; height: 14px; }
.pin-privacy-badge {
  margin-left: auto;
  font-size: 10px;
  color: rgba(61,40,32,0.35);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* =========================================================
   FEED
   ========================================================= */
.feed-container {
  display: flex;
  flex-direction: column;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.feed-title {
  font-family: var(--font-hand);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.feed-filters {
  display: flex;
  gap: 6px;
}
.feed-filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: none;
  font-size: 13px;
  color: var(--text-mid);
  transition: all 0.15s;
}
.feed-filter-btn:hover, .feed-filter-btn.active {
  background: var(--peach-light);
  border-color: var(--peach);
  color: var(--accent);
}

/* =========================================================
   CREATE PIN BUTTON (FAB)
   ========================================================= */
.fab-create-pin {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px; height: 56px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(224,112,96,0.4);
  color: #fff;
  font-size: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 150;
}
.fab-create-pin:hover { transform: scale(1.08) rotate(15deg); box-shadow: 0 6px 28px rgba(224,112,96,0.5); }

/* =========================================================
   CREATE PIN MODAL
   ========================================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61,40,32,0.35);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

.create-pin-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(61,40,32,0.2);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.open .create-pin-modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--peach-light);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--rose-light); }

/* Note color row */
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.color-row-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
  flex-shrink: 0;
  min-width: 48px;
}
.swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.swatch:hover { transform: scale(1.18); }
.swatch.active { border-color: var(--text); transform: scale(1.15); }
.swatch.active::after { /* checkmark dot */
  content: '';
  display: block;
  width: 8px; height: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 50%;
  margin: 5px auto 0;
}

/* Mode toggle */
.mode-toggle {
  display: flex;
  gap: 0;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
}
.mode-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border);
  background: var(--cream);
  font-size: 14px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.18s;
}
.mode-btn:first-child { border-radius: 8px 0 0 8px; }
.mode-btn:last-child  { border-radius: 0 8px 8px 0; border-left: none; }
.mode-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }

/* Textarea */
.pin-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-hand);
  font-size: 20px;
  line-height: 1.55;
  color: var(--text);
  background: var(--peach-light);
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.pin-textarea::placeholder { color: var(--text-light); font-style: italic; }
.pin-textarea:focus { border-color: var(--accent); background: var(--cream); }

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
  transition: color 0.15s;
}
.char-count.warn { color: var(--accent); }
.char-count.over { color: var(--pin-red); font-weight: 500; }

/* Draw canvas */
.draw-toolbar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.brush-dot {
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.brush-dot:hover { transform: scale(1.2); }
.brush-dot.active { border-color: var(--text); transform: scale(1.15); }
.brush-size-dot { background: var(--text-mid); cursor: pointer; border-radius: 50%; flex-shrink: 0; }
.brush-size-dot.active { background: var(--accent); }

.pin-canvas {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: crosshair;
  touch-action: none;
  display: block;
  background: var(--peach-light);
}

/* Toolbar row */
.pin-toolbar {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tool-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid);
  transition: all 0.15s;
  position: relative;
}
.tool-btn:hover { background: var(--peach-light); color: var(--text); }
.tool-btn.active { background: var(--rose-light); color: var(--accent); }
.tool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* Extra panels */
.extra-panel {
  padding: 0 22px 14px;
  display: none;
  animation: slideDown 0.2s ease;
}
.extra-panel.open { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.extra-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.extra-close-btn {
  background: none; border: none;
  color: var(--text-light); font-size: 16px;
}

/* Map */
.modal-map { height: 160px; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--border); }
.loc-search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.loc-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  background: var(--cream);
  outline: none;
  color: var(--text);
}
.loc-input:focus { border-color: var(--accent); }
.loc-me-btn {
  padding: 7px 14px;
  background: var(--sage-light);
  border: 1px solid var(--sage);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1a5c35;
  white-space: nowrap;
}

/* Media upload */
.media-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.media-drop:hover { border-color: var(--accent); background: var(--peach-light); }
.media-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.media-drop-text { font-size: 13px; color: var(--text-light); margin-top: 6px; }

/* Modal submit row */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
}
.btn-cancel {
  background: none; border: none;
  color: var(--text-light); font-size: 14px;
}
.btn-cancel:hover { color: var(--text); }
.btn-post-pin {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 26px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s, transform 0.1s;
}
.btn-post-pin:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* =========================================================
   DIRECT PIN OVERLAY (incoming message)
   ========================================================= */
.direct-pin-overlay {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
}
.incoming-pin {
  position: relative;
  border-radius: 2px;
  padding: 22px 18px 16px;
  width: 260px;
  box-shadow: 4px 6px 24px rgba(61,40,32,0.25);
  animation: pinFlyIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pinFlyIn {
  from { opacity: 0; transform: translateX(80px) rotate(8deg); }
  to   { opacity: 1; transform: translateX(0) rotate(-2deg); }
}
.incoming-pin .pin-head {
  top: -12px;
}
.incoming-pin-from { font-size: 12px; color: rgba(61,40,32,0.5); margin-bottom: 6px; }
.incoming-pin-text {
  font-family: var(--font-hand);
  font-size: 18px;
  line-height: 1.5;
  color: rgba(61,40,32,0.82);
}
.incoming-pin-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.incoming-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(61,40,32,0.15);
  font-size: 12px;
  background: rgba(255,255,255,0.4);
  color: rgba(61,40,32,0.7);
  transition: all 0.15s;
  text-align: center;
}
.incoming-btn:hover { background: rgba(255,255,255,0.7); }
.incoming-btn.primary { background: rgba(61,40,32,0.1); font-weight: 500; }

/* =========================================================
   TIMELINE (cork board)
   ========================================================= */
.timeline-board {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(244,168,184,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168,196,232,0.12) 0%, transparent 50%);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  min-height: 600px;
}

.timeline-grid {
  columns: 2;
  gap: 28px;
}
.timeline-grid .pin-card { break-inside: avoid; margin-bottom: 28px; }

@media (max-width: 600px) {
  .timeline-grid { columns: 1; }
}

.timeline-header {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}
.timeline-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--peach);
  box-shadow: var(--shadow-md);
}
.timeline-name { font-family: var(--font-hand); font-size: 32px; font-weight: 700; color: var(--accent); }
.timeline-bio { font-size: 14px; color: var(--text-mid); margin-top: 4px; }
.timeline-actions { margin-left: auto; display: flex; gap: 8px; }

/* =========================================================
   PROFILE PAGE
   ========================================================= */
.profile-hero {
  background: linear-gradient(135deg, var(--peach-light), var(--lavender-light));
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  top: -60px; right: -60px;
}
.profile-hero-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: var(--shadow-md);
  margin: 0 auto 14px;
  object-fit: cover;
  display: block;
}
.profile-hero-name { font-family: var(--font-hand); font-size: 30px; font-weight: 700; color: var(--text); }
.profile-hero-handle { color: var(--text-mid); font-size: 14px; margin-top: 3px; }
.profile-hero-bio { font-size: 14px; color: var(--text-mid); margin-top: 10px; max-width: 400px; margin-left: auto; margin-right: auto; }
.profile-stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}
.profile-stat-num { font-family: var(--font-hand); font-size: 26px; font-weight: 700; color: var(--accent); }
.profile-stat-label { font-size: 12px; color: var(--text-light); }
.profile-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* =========================================================
   CHAT
   ========================================================= */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-h) - 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.chat-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--cream);
}
.chat-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-hand);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 1;
}
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.chat-item:hover, .chat-item.active { background: var(--peach-light); }
.chat-item-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-item-name { font-weight: 500; font-size: 14px; }
.chat-item-preview { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; margin-top: 2px; }
.chat-item-time { font-size: 11px; color: var(--text-light); margin-left: auto; flex-shrink: 0; }
.chat-unread {
  min-width: 18px; height: 18px;
  background: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.chat-window {
  display: flex;
  flex-direction: column;
}
.chat-window-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.chat-bubble.mine {
  background: var(--peach-light);
  border: 1px solid var(--peach);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.theirs {
  background: var(--sage-light);
  border: 1px solid var(--sage);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-bubble-time {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}

.chat-input-row {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  background: var(--cream);
  outline: none;
  resize: none;
  max-height: 100px;
  color: var(--text);
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.chat-send-btn:hover { transform: scale(1.1); }
.chat-pin-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--peach-light);
  border: 1px solid var(--peach);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* =========================================================
   NOTIFICATIONS
   ========================================================= */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.15s;
  cursor: pointer;
}
.notif-item:hover { background: var(--peach-light); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.notif-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.notif-text { font-size: 14px; flex: 1; }
.notif-text strong { font-weight: 500; }
.notif-time { font-size: 12px; color: var(--text-light); flex-shrink: 0; }
.notif-pin-preview {
  width: 36px; height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* =========================================================
   DISCOVER
   ========================================================= */
.discover-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.discover-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  font-size: 15px;
  background: var(--surface);
  outline: none;
  color: var(--text);
  transition: border-color 0.18s;
}
.discover-input:focus { border-color: var(--accent); }
.discover-search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 24px;
  font-size: 14px;
  font-weight: 500;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow 0.15s;
}
.user-card:hover { box-shadow: var(--shadow-sm); }
.user-card-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--peach);
}
.user-card-name { font-weight: 500; }
.user-card-handle { font-size: 13px; color: var(--text-light); }
.btn-follow {
  margin-left: auto;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--accent);
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-follow:hover, .btn-follow.following {
  background: var(--accent);
  color: #fff;
}

/* =========================================================
   SETTINGS
   ========================================================= */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.settings-sidebar a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-mid);
  transition: all 0.15s;
}
.settings-sidebar a:hover, .settings-sidebar a.active {
  background: var(--peach-light);
  color: var(--accent);
}
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}
.settings-section-title { font-size: 16px; font-weight: 500; margin-bottom: 18px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--cream);
  outline: none;
  transition: border-color 0.18s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { min-height: 100px; resize: vertical; }
.btn-save {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.18s;
}
.btn-save:hover { background: var(--accent-dark); }

/* Privacy option group */
.privacy-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.privacy-option:hover { background: var(--peach-light); border-color: var(--peach); }
.privacy-option input { accent-color: var(--accent); width: 16px; height: 16px; }
.privacy-option-text { font-size: 14px; }
.privacy-option-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* =========================================================
   BUTTONS (shared)
   ========================================================= */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 20px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; transition: all 0.18s; border: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline { background: none; border: 1.5px solid var(--border); color: var(--text-mid); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--peach-light); }
.btn-ghost { background: none; border: none; color: var(--text-mid); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #FFE8E8; color: var(--pin-red); border: 1px solid #FFCCCC; }
.btn-danger:hover { background: #FFD0D0; }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--peach-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-family: var(--font-hand); font-size: 22px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .page-layout { grid-template-columns: 200px 1fr 240px; }
}
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar-right { display: none; }
  .page-layout.two-col { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - var(--nav-h) - 20px); }
  .chat-list { height: 180px; border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .pintense-nav { padding: 0 16px; }
  .page-layout { padding: 16px; }
  .fab-create-pin { bottom: 20px; right: 20px; }
  .direct-pin-overlay { bottom: 16px; right: 16px; }
  .incoming-pin { width: 220px; }
}

/* =========================================================
   v1.1 ADDITIONS & FIXES
   ========================================================= */

/* ── Emoji grid popup ─── */
.emoji-grid {
  position: absolute;
  top: 40px; left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: 210px;
  z-index: 50;
  box-shadow: var(--shadow-md);
}
.emoji-grid.hidden { display: none !important; }
.emoji-pick {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; border-radius: 4px;
  transition: background 0.1s;
}
.emoji-pick:hover { background: var(--peach-light); }

/* ── Fix: pin cards stay together (no column split) ─── */
.timeline-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  align-items: start;
}
.profile-pin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 600px) {
  .timeline-grid, .profile-pin-grid { grid-template-columns: 1fr; }
}

/* ── Repin attribution ─── */
.pin-repin-attr {
  font-size: 11px; color: rgba(61,40,32,0.45);
  margin-bottom: 6px; display: flex; align-items: center; gap: 4px;
}
.pin-repin-attr a { color: var(--accent); text-decoration: none; }
.pin-repin-attr a:hover { text-decoration: underline; }

/* ── Comments panel ─── */
.pin-comments-panel {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(61,40,32,0.08);
  animation: slideDown 0.2s ease;
}
.pin-comments { display: flex; flex-direction: column; gap: 8px; }
.comment-item { display: flex; gap: 8px; align-items: flex-start; }
.comment-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1.5px solid rgba(255,255,255,0.6);
}
.comment-body {
  flex: 1; background: rgba(255,255,255,0.45);
  border-radius: 10px; padding: 6px 10px; font-size: 13px; line-height: 1.5;
}
.comment-author {
  font-weight: 500; margin-right: 6px; color: rgba(61,40,32,0.7);
  text-decoration: none; font-size: 12px;
}
.comment-author:hover { text-decoration: underline; }
.comment-text { color: rgba(61,40,32,0.8); }
.comment-time { font-size: 10px; color: rgba(61,40,32,0.4); margin-left: 6px; }
.comment-input-row { display: flex; gap: 6px; margin-top: 8px; }
.comment-input {
  flex: 1; border: 1.5px solid rgba(61,40,32,0.12); border-radius: 20px;
  padding: 6px 12px; font-size: 13px; background: rgba(255,255,255,0.5);
  outline: none; color: var(--text); font-family: var(--font-ui);
}
.comment-input:focus { border-color: rgba(61,40,32,0.3); background: rgba(255,255,255,0.75); }

/* ── Location search results ─── */
#locSearchResults {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  overflow: hidden; max-height: 200px; overflow-y: auto;
}
#locSearchResults:empty { display: none; }
.loc-result-item:last-child { border-bottom: none !important; }

/* ── Pin card: varied horizontal nudge ─── */
.pin-card:nth-child(3n+1) { margin-left: 4px; }
.pin-card:nth-child(3n+2) { margin-left: -2px; }
.pin-card:nth-child(3n)   { margin-left: 6px; }

/* =========================================================
   v1.2 — AUTH MODAL, HASHTAGS, MENTIONS
   ========================================================= */

/* ── Auth modal (login/register) ─── */
.auth-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(61,40,32,0.22);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.open .auth-modal { transform: translateY(0) scale(1); }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.18s;
  border-bottom: 2px solid transparent;
}
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--peach-light);
}
.auth-panel { padding: 24px; display: none; }
.auth-panel.active { display: block; }
.auth-logo {
  font-family: var(--font-hand);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-sub { text-align: center; font-size: 13px; color: var(--text-light); margin-bottom: 20px; }

.auth-field { margin-bottom: 14px; }
.auth-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-mid); margin-bottom: 5px; letter-spacing: 0.03em; }
.auth-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--cream);
  outline: none;
  font-family: var(--font-ui);
  transition: border-color 0.18s;
}
.auth-input:focus { border-color: var(--accent); background: #fff; }
.auth-input.error { border-color: var(--pin-red); }

.auth-username-status {
  font-size: 11px;
  margin-top: 4px;
  height: 14px;
}
.auth-username-status.ok   { color: #1A5C35; }
.auth-username-status.fail { color: var(--pin-red); }

/* Color picker in auth modal */
.auth-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.auth-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.auth-swatch:hover { transform: scale(1.15); }
.auth-swatch.active { border-color: var(--text); transform: scale(1.15); }

.auth-error {
  background: #FFE8E8;
  border: 1px solid #FFCCCC;
  color: var(--pin-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.auth-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.18s, transform 0.1s;
}
.auth-submit:hover { background: var(--accent-dark); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-footer-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 14px;
}
.auth-footer-link a { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* ── Hashtags and mentions in pin content ─── */
.pin-content .pin-hashtag,
.comment-text .pin-hashtag {
  color: var(--pin-navy);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.pin-content .pin-hashtag:hover { color: var(--accent); }

.pin-content .pin-mention,
.comment-text .pin-mention {
  color: var(--pin-plum);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.pin-content .pin-mention:hover { color: var(--accent); }

/* ── Mention autocomplete dropdown in create pin ─── */
.mention-dropdown {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  min-width: 200px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.mention-dropdown.open { display: block; }
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s;
}
.mention-item:hover { background: var(--peach-light); }
.mention-item img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.mention-item-name { font-weight: 500; }
.mention-item-handle { font-size: 12px; color: var(--text-light); }

/* ── Hashtag page header ─── */
.hashtag-header {
  background: linear-gradient(135deg, var(--lavender-light), var(--sky-light));
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hashtag-title {
  font-family: var(--font-hand);
  font-size: 32px;
  font-weight: 700;
  color: var(--pin-navy);
}

/* ── nav right msg badge ─── */
#navMsgBadge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: var(--pin-navy);
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 600;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--cream);
}

/* =========================================================
   v1.3 — MOBILE NAV + CHAT FIXES
   ========================================================= */

/* ── Bottom mobile nav bar ─── */
:root { --mobile-nav-h: 60px; }

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: rgba(255,248,242,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 200;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-ui);
  padding: 6px 4px;
  transition: color 0.15s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item:hover  { color: var(--text); }
.mobile-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  min-width: 16px; height: 16px;
  background: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 9px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--cream);
}

/* ── Mobile layout adjustments ─── */
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }

  /* Push page content above bottom nav */
  .page-body { padding-bottom: var(--mobile-nav-h); }

  /* Top nav: only logo + right actions */
  .nav-links { display: none !important; }
  .pintense-nav { padding: 0 14px; }

  /* FAB: move up above bottom nav, left side on chat page */
  .fab-create-pin {
    bottom: calc(var(--mobile-nav-h) + 14px);
    right: 16px;
    width: 50px; height: 50px;
  }

  /* Page layout */
  .page-layout { padding: 12px; gap: 12px; }

  /* Profile hero */
  .profile-hero { padding: 20px 16px; }
  .profile-stats-row { gap: 16px; }

  /* Pin card smaller on mobile */
  .pin-content { font-size: 17px; }
  .timeline-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Chat: fix layout so messages scroll and input stays at bottom ─── */
.chat-layout {
  /* Use flex so it respects available height perfectly */
  display: flex;
  flex-direction: row;
}

.chat-list {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#conversationItems {
  flex: 1;
  overflow-y: auto;
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* key: prevents window from growing */
  min-width: 0;
}
.chat-window-header {
  flex-shrink: 0;  /* header never shrinks */
  padding: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;     /* scrollable messages */
  overflow-x: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-input-row {
  flex-shrink: 0;  /* input row never shrinks */
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--surface);
}

/* Scrollbar for chat messages */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--peach); border-radius: 4px; }

@media (max-width: 768px) {
  .chat-layout {
    flex-direction: column;
    height: calc(100vh - var(--nav-h) - var(--mobile-nav-h) - 24px);
  }
  .chat-list {
    width: 100%;
    min-width: 0;
    height: 160px;
    min-height: 160px;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  #conversationItems { overflow-y: auto; }
  .chat-window { flex: 1; min-height: 0; }
  .chat-messages { padding: 12px; }

  /* Hide FAB on chat page to avoid overlap */
  .page-chat .fab-create-pin { display: none !important; }
}

@media (max-width: 480px) {
  .chat-bubble { max-width: 85%; font-size: 14px; }
  .chat-input { font-size: 16px; } /* prevent iOS zoom */
  .pin-card { margin-left: 0 !important; }
  .incoming-pin { width: 200px; right: 8px; }
  .direct-pin-overlay { right: 8px; bottom: calc(var(--mobile-nav-h) + 8px); }
}

/* ── Nav: hide top nav links on desktop too for two-col on small desktop ─── */
@media (max-width: 900px) and (min-width: 769px) {
  .nav-links .nav-link span { display: none; }
  .nav-link { padding: 7px 10px; }
}
