/* ═══════════════════════════════════════
   DAYUPDATES — style.css  v3 (Firebase)
═══════════════════════════════════════ */

:root {
  --bg:        #f7f2ea;
  --bg2:       #ede6d5;
  --bg3:       #e4dbc8;
  --ink:       #1c1710;
  --ink2:      #4a3f30;
  --ink3:      #8a7a68;
  --accent:    #c0440e;
  --accent2:   #e07a3a;
  --gold:      #c99b3f;
  --sage:      #6b7b5c;
  --danger:    #b52a2a;
  --border:    #d4c8b0;
  --shadow:    rgba(28,23,16,.10);
  --shadow-lg: rgba(28,23,16,.22);
  --radius:    6px;
  --font-d: 'Cormorant Garamond', Georgia, serif;
  --font-b: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c4b49a' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  font-family: var(--font-b);
  color: var(--ink);
  min-height: 100vh;
}

/* ── BANNER ── */
.new-posts-banner {
  display: none; align-items: center; gap: 10px;
  background: var(--gold); color: var(--ink);
  padding: 10px 20px; font-size: 13px;
  position: sticky; top: 0; z-index: 200;
  animation: slideDown .35s ease;
}
.new-posts-banner.visible { display: flex; }
.banner-icon { font-size: 16px; }
.banner-refresh {
  background: var(--ink); color: var(--bg);
  border: none; border-radius: 100px;
  padding: 5px 14px; font-size: 12px; cursor: pointer;
  font-family: var(--font-b); margin-left: 4px; transition: background .2s;
}
.banner-refresh:hover { background: var(--accent); }
.banner-dismiss { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--ink2); margin-left: auto; }

/* ── NAVBAR ── */
.navbar { background: var(--ink); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 20px var(--shadow-lg); }
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 16px;
  min-height: 64px; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.nav-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-icon { font-size: 20px; color: var(--gold); line-height: 1; }
.brand-name {
  font-family: var(--font-d); font-size: 1.35rem; font-weight: 600;
  color: var(--bg); letter-spacing: .5px; white-space: nowrap;
}
.nav-tagline { font-size: 12px; color: #8a7a68; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; flex-wrap: wrap; }

/* Google sign-in button */
.btn-google-signin {
  display: flex; align-items: center; gap: 6px;
  background: #fff; color: #3c4043;
  border: none; border-radius: var(--radius);
  padding: 7px 12px; font-family: var(--font-b);
  font-size: 12px; font-weight: 500; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: box-shadow .2s, background .2s;
  white-space: nowrap; flex-shrink: 0;
}
.btn-google-signin:hover { box-shadow: 0 2px 8px rgba(0,0,0,.25); background: #f8f8f8; }
/* Hide text on very small screens, show only icon */
.btn-google-signin .signin-text { display: inline; }

/* User chip (logged in) */
.user-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 100px; padding: 3px 10px 3px 3px;
  flex-shrink: 0;
}
.user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.user-name { font-size: 12px; color: var(--bg); max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-signout {
  background: none; border: none; color: var(--ink3);
  font-size: 15px; cursor: pointer; padding: 0 0 0 2px;
  transition: color .2s; line-height: 1;
}
.btn-signout:hover { color: var(--accent2); }

.nav-icon-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius); padding: 6px 10px; color: var(--bg);
  font-size: 13px; cursor: pointer; display: flex; align-items: center;
  gap: 4px; transition: background .2s; flex-shrink: 0;
}
.nav-icon-btn:hover { background: rgba(255,255,255,.16); }
.bookmark-count-badge {
  background: var(--gold); color: var(--ink); font-size: 10px; font-weight: 600;
  border-radius: 100px; padding: 1px 5px; min-width: 16px; text-align: center;
}
.btn-write {
  background: var(--accent); color: #fff; border: none;
  padding: 8px 14px; border-radius: var(--radius);
  font-family: var(--font-b); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .2s, transform .15s;
  white-space: nowrap; flex-shrink: 0;
}
.btn-write:hover { background: var(--accent2); transform: translateY(-1px); }

/* ── HERO ── */
.hero {
  max-width: 960px; margin: 0 auto; padding: 56px 24px 40px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  animation: fadeUp .7s ease both;
}
.hero-text h1 { font-family: var(--font-d); font-size: clamp(2.8rem,7vw,5rem); font-weight: 400; line-height: 1.05; }
.hero-text h1 em { color: var(--accent); font-style: italic; }
.hero-text p { margin-top: 14px; font-size: 15px; color: var(--ink2); max-width: 340px; line-height: 1.6; }
.hero-stats { display: flex; align-items: center; gap: 28px; flex-shrink: 0; padding-bottom: 8px; }
.stat { text-align: center; }
.stat span { display: block; font-family: var(--font-d); font-size: 2.2rem; font-weight: 600; line-height: 1; }
.stat small { font-size: 11px; color: var(--ink3); letter-spacing: 1px; text-transform: uppercase; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* ── TRENDING ── */
.trending-section { max-width: 960px; margin: 0 auto 28px; padding: 0 24px; animation: fadeUp .75s ease .05s both; }
.trending-inner {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; display: flex; align-items: center; gap: 20px;
  overflow-x: auto; scrollbar-width: none;
}
.trending-inner::-webkit-scrollbar { display: none; }
.trending-label { font-size: 12px; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; }
.trending-list { display: flex; gap: 10px; align-items: center; }
.trending-chip {
  background: var(--bg); border: 1px solid var(--border); border-radius: 100px;
  padding: 5px 14px; font-size: 12.5px; color: var(--ink2); cursor: pointer;
  white-space: nowrap; display: flex; align-items: center; gap: 7px; transition: all .18s; flex-shrink: 0;
}
.trending-chip:hover { border-color: var(--accent); color: var(--accent); }
.trending-chip .chip-likes { color: var(--ink3); font-size: 11px; }

/* ── CONTROLS ── */
.controls-bar {
  max-width: 960px; margin: 0 auto 32px; padding: 0 24px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  animation: fadeUp .8s ease .1s both;
}
.search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 280px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--ink3); pointer-events: none; }
.search-input {
  width: 100%; background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 9px 16px 9px 36px;
  font-family: var(--font-b); font-size: 13px; color: var(--ink); outline: none; transition: border-color .2s;
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--ink3); }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--bg2); border: 1.5px solid var(--border); border-radius: 100px;
  padding: 7px 16px; font-family: var(--font-b); font-size: 12px;
  cursor: pointer; color: var(--ink2); transition: all .18s;
}
.pill:hover { border-color: var(--gold); }
.pill.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ── FEED ── */
.feed {
  max-width: 960px; margin: 0 auto; padding: 0 24px 80px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px,1fr)); gap: 20px;
}
.loading-state { grid-column: 1/-1; text-align: center; padding: 80px 0; color: var(--ink3); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { font-size: 14px; font-style: italic; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 80px 0; color: var(--ink3); }
.empty-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.empty-state p { font-size: 15px; font-style: italic; }

/* ── POST CARD ── */
.post-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px 18px; box-shadow: 0 3px 18px var(--shadow);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden; animation: fadeUp .45s ease both;
}
.post-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg,var(--accent),var(--gold));
  opacity: 0; transition: opacity .2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 32px var(--shadow-lg); }
.post-card:hover::before { opacity: 1; }
.post-card.bookmarked::after { content: '🔖'; position: absolute; top: 10px; right: 10px; font-size: 14px; opacity: .7; }

.card-top { display: flex; align-items: center; gap: 10px; }
.card-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.card-avatar-fallback {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-size: 1rem; font-weight: 600; color: #fff; flex-shrink: 0;
}
.card-author-block { flex: 1; min-width: 0; }
.card-author { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 11px; color: var(--ink3); }
.card-mood-tag {
  font-size: 11px; background: rgba(255,255,255,.5); border: 1px solid var(--border);
  border-radius: 100px; padding: 2px 10px; color: var(--ink2); white-space: nowrap; flex-shrink: 0;
}
.card-title { font-family: var(--font-d); font-size: 1.2rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.card-preview {
  font-size: 13.5px; line-height: 1.65; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.card-footer {
  display: flex; align-items: center; gap: 14px;
  padding-top: 10px; border-top: 1px solid rgba(0,0,0,.07); margin-top: auto;
}
.like-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--ink3); padding: 4px 8px; border-radius: 100px; transition: all .15s;
}
.like-btn:hover { background: rgba(192,68,14,.08); color: var(--accent); }
.like-btn.liked { color: var(--accent); }
.like-btn.liked .heart-icon { animation: pop .3s ease; }
.heart-icon { font-size: 15px; }
.bookmark-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--ink3); padding: 4px 6px; border-radius: 100px; transition: all .15s;
}
.bookmark-btn:hover { color: var(--gold); }
.bookmark-btn.saved { color: var(--gold); }
.comment-count-pill { font-size: 12px; color: var(--ink3); display: flex; align-items: center; gap: 4px; }
.card-read-more { margin-left: auto; font-size: 12px; color: var(--ink3); text-decoration: underline; text-underline-offset: 3px; }

/* ── OVERLAYS & MODALS ── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(28,23,16,.6); backdrop-filter: blur(4px);
  z-index: 300; align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 28px 90px var(--shadow-lg); position: relative; width: 100%;
  animation: popIn .28s ease; max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  font-size: 18px; cursor: pointer; color: var(--ink3);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; z-index: 2;
}
.modal-close:hover { background: var(--bg3); color: var(--accent); }

/* WRITE MODAL */
.write-modal { max-width: 560px; padding: 44px 44px 36px; }
.modal-heading { font-family: var(--font-d); font-size: 2rem; font-weight: 400; font-style: italic; color: var(--ink); margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--ink3); margin-bottom: 24px; }

.author-preview {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 20px;
}
.author-preview-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.author-preview-badge {
  margin-left: auto; font-size: 11px; color: var(--sage);
  background: rgba(107,123,92,.12); border-radius: 100px; padding: 2px 10px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-field label { font-size: 12px; font-weight: 500; letter-spacing: .5px; color: var(--ink2); text-transform: uppercase; }
.form-field .optional { color: var(--ink3); font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-field input, .form-field textarea {
  background: var(--bg2); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-family: var(--font-b); font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .2s; resize: vertical;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--gold); }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--ink3); }
.form-field textarea { min-height: 130px; line-height: 1.65; }
.char-count { font-size: 11px; color: var(--ink3); text-align: right; }

.mood-select { display: flex; flex-wrap: wrap; gap: 6px; }
.mood-opt {
  background: var(--bg2); border: 1.5px solid var(--border); border-radius: 100px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--ink2);
  font-family: var(--font-b); transition: all .15s;
}
.mood-opt:hover { border-color: var(--gold); }
.mood-opt.selected { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2.5px solid transparent; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  color: transparent; transition: transform .15s, border-color .15s;
  box-shadow: 0 1px 4px var(--shadow);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--ink); color: var(--ink); }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.btn-secondary {
  background: none; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 22px; font-family: var(--font-b); font-size: 13px; cursor: pointer; color: var(--ink2); transition: border-color .2s;
}
.btn-secondary:hover { border-color: var(--ink2); }
.btn-primary {
  background: var(--accent); border: 1.5px solid var(--accent); border-radius: var(--radius);
  padding: 10px 28px; font-family: var(--font-b); font-size: 13px; font-weight: 500; color: #fff;
  cursor: pointer; transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-danger {
  background: var(--danger); border: 1.5px solid var(--danger); border-radius: var(--radius);
  padding: 10px 22px; font-family: var(--font-b); font-size: 13px; font-weight: 500; color: #fff;
  cursor: pointer; transition: background .2s;
}
.btn-danger:hover { background: #8b1f1f; }

/* BOOKMARKS MODAL */
.bookmarks-modal { max-width: 540px; padding: 44px 40px 36px; }
.bookmarks-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.bm-item {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; cursor: pointer; transition: background .15s; display: flex; align-items: center; gap: 14px;
}
.bm-item:hover { background: var(--bg3); }
.bm-item-text { flex: 1; min-width: 0; }
.bm-item-title { font-family: var(--font-d); font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-item-meta { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.bm-item-remove { background: none; border: none; cursor: pointer; color: var(--ink3); font-size: 15px; flex-shrink: 0; transition: color .15s; }
.bm-item-remove:hover { color: var(--danger); }
.bm-empty { text-align: center; padding: 40px 0; color: var(--ink3); font-style: italic; font-size: 14px; }

/* DETAIL MODAL */
.detail-modal { max-width: 640px; padding: 44px 44px 36px; }
.detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.detail-avatar-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.detail-author { font-size: 15px; font-weight: 500; }
.detail-meta { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.dot { margin: 0 4px; }
.detail-title { font-family: var(--font-d); font-size: 1.9rem; font-weight: 600; line-height: 1.2; margin-bottom: 16px; }
.detail-body { font-size: 15px; line-height: 1.85; color: var(--ink2); white-space: pre-wrap; margin-bottom: 24px; }
.btn-delete-post {
  background: none; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 6px 12px; font-size: 12px; color: var(--ink3); cursor: pointer;
  flex-shrink: 0; transition: all .2s; font-family: var(--font-b);
}
.btn-delete-post:hover { border-color: var(--danger); color: var(--danger); }

.detail-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.like-btn-large {
  background: none; border: 1.5px solid var(--border); border-radius: 100px;
  padding: 9px 22px; font-family: var(--font-b); font-size: 14px;
  cursor: pointer; color: var(--ink2); display: flex; align-items: center; gap: 8px; transition: all .2s;
}
.like-btn-large:hover { border-color: var(--accent); color: var(--accent); }
.like-btn-large.liked { border-color: var(--accent); color: var(--accent); background: rgba(192,68,14,.08); }
.like-btn-large.liked .heart-icon { animation: pop .3s ease; }
.bookmark-btn-large {
  background: none; border: 1.5px solid var(--border); border-radius: 100px;
  padding: 9px 22px; font-family: var(--font-b); font-size: 14px;
  cursor: pointer; color: var(--ink2); display: flex; align-items: center; gap: 8px; transition: all .2s;
}
.bookmark-btn-large:hover { border-color: var(--gold); color: var(--gold); }
.bookmark-btn-large.saved { border-color: var(--gold); color: var(--gold); background: rgba(201,155,63,.09); }

/* COMMENTS */
.comments-heading { font-family: var(--font-d); font-size: 1.1rem; font-weight: 400; margin-bottom: 16px; }
.comments-heading span { font-family: var(--font-b); font-size: 12px; color: var(--ink3); margin-left: 6px; }
.comments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; animation: fadeUp .3s ease; }
.comment-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.comment-author { font-size: 12px; font-weight: 500; flex: 1; }
.comment-time { font-size: 11px; color: var(--ink3); }
.comment-text { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.no-comments { font-size: 13px; color: var(--ink3); font-style: italic; text-align: center; padding: 16px 0; }
.comment-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.comment-text-input {
  background: var(--bg2); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; font-family: var(--font-b); font-size: 13px; color: var(--ink);
  outline: none; flex: 1; min-width: 120px; transition: border-color .2s;
}
.comment-text-input:focus { border-color: var(--gold); }
.comment-text-input::placeholder { color: var(--ink3); }
.btn-comment { background: var(--sage); border: none; border-radius: var(--radius); padding: 9px 18px; font-family: var(--font-b); font-size: 13px; color: #fff; cursor: pointer; transition: background .2s; }
.btn-comment:hover { background: #556248; }
.comment-signin-note { font-size: 13px; color: var(--ink3); font-style: italic; }
.comment-signin-note a { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* CONFIRM MODAL */
.confirm-modal { max-width: 380px; padding: 40px 36px 32px; }

/* TOAST */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--bg); font-size: 13px;
  padding: 12px 24px; border-radius: 100px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 999; white-space: nowrap; font-family: var(--font-b);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ANIMATIONS */
@keyframes fadeUp  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes popIn   { from { opacity:0; transform:scale(.96); }       to { opacity:1; transform:scale(1); } }
@keyframes pop     { 0%{transform:scale(1)} 50%{transform:scale(1.5)} 100%{transform:scale(1)} }
@keyframes slideDown { from { transform:translateY(-100%); opacity:0; } to { transform:translateY(0); opacity:1; } }

/* ── RESPONSIVE ── */

/* Tablet — hide tagline, tighten gaps */
@media (max-width: 768px) {
  .nav-tagline { display: none; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-stats { gap: 20px; }
  .write-modal, .detail-modal { padding: 32px 24px; }
  .feed { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Mobile — single column, compact nav */
@media (max-width: 540px) {
  /* Navbar: brand + actions only, single row */
  .nav-inner { padding: 0 12px; gap: 8px; min-height: 56px; }
  .brand-name { font-size: 1.1rem; }
  .brand-icon { font-size: 17px; }

  /* Shrink sign-in button to icon only on tiny screens */
  .btn-google-signin .signin-text { display: none; }
  .btn-google-signin { padding: 7px 10px; }

  /* Hide username, show avatar + signout only */
  .user-name { display: none; }
  .user-chip { padding: 3px 6px 3px 3px; }

  /* Write button shorter */
  .btn-write { padding: 7px 10px; font-size: 11px; }
  .write-text { display: none; }

  /* Bookmarks badge tighter */
  .nav-icon-btn { padding: 6px 8px; }

  /* Hero */
  .hero { padding: 32px 16px 24px; }
  .hero-text h1 { font-size: 2.4rem; }
  .hero-stats { gap: 14px; }
  .stat span { font-size: 1.8rem; }

  /* Controls */
  .controls-bar { padding: 0 16px; gap: 10px; }
  .search-wrap { max-width: 100%; flex: 1 1 100%; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 4px; }
  .filter-pills::-webkit-scrollbar { display: none; }
  .pill { flex-shrink: 0; }

  /* Feed */
  .feed { grid-template-columns: 1fr; padding: 0 16px 60px; gap: 14px; }

  /* Modals */
  .write-modal, .detail-modal, .bookmarks-modal, .confirm-modal {
    padding: 28px 18px 24px; margin: 0;
    border-radius: var(--radius); max-height: 95vh;
  }
  .overlay { padding: 12px; align-items: flex-end; }
  .modal-heading { font-size: 1.6rem; }
  .detail-title { font-size: 1.5rem; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; text-align: center; }
  .comment-input-row { flex-direction: column; }
  .comment-text-input { width: 100%; }
  .btn-comment { width: 100%; }
  .detail-actions { flex-wrap: wrap; }
  .like-btn-large, .bookmark-btn-large { flex: 1; justify-content: center; }
}

/* Very small screens (< 360px) */
@media (max-width: 360px) {
  .brand-name { font-size: 1rem; }
  .hero-stats { flex-wrap: wrap; gap: 12px; }
  .stat-divider { display: none; }
}
