:root{
  --bg:#fff; --fg:#111; --muted:#666; --line:#e6e6e6; --brand:#0b5e36; --accent:#39a866; --badge:#e33;
  /* NEW */
  --thread-bg:#f6f7f8;   /* top-level discussions */
  --reply-bg:#ffffff;    /* replies */
}

html[data-theme="dark"]{
  --bg:#0f1411; --fg:#f2fff7; --muted:#a6b2aa; --line:#243229; --brand:#39a866; --accent:#74d69e; --badge:#ff5555;
  /* NEW */
  --thread-bg:#0f1211;   /* very dark for root threads (close to your --bg) */
  --reply-bg:#161b17;    /* slightly lighter for replies */
}

*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--fg)}
a{color:var(--brand);font-weight:700;text-decoration:none}img{max-width:100%;display:block}
.topbar{position:sticky;top:0;z-index:10;background:var(--bg);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:10px 14px}
.topbar .brand{flex:1;text-align:center;font-weight:800;letter-spacing:.5px}
.icon-btn{background:none;border:0;font-size:20px;cursor:pointer;color:var(--fg)}
.rel{position:relative}.badge{position:absolute;top:-6px;right:-6px;background:var(--badge);color:#fff;font-size:11px;line-height:1;padding:4px 6px;border-radius:10px;min-width:18px;text-align:center}
.dropdown{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:flex-start;justify-content:center;padding:20px;z-index:20}
.dropdown.hidden{display:none}.dropdown-inner{width:100%;max-width:580px;background:var(--bg);color:var(--fg);border-radius:18px;box-shadow:0 12px 40px rgba(0,0,0,.3);overflow:hidden}
.dropdown-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.dropdown ul{list-style:none;margin:0;padding:0}.dropdown li{padding:14px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}
.page{padding:10px 0 80px;max-width:720px;margin:0 auto}
.card{background:var(--bg);border:1px solid var(--line);border-radius:14px;padding:12px;margin:10px 14px}
.card .meta{display:flex;gap:10px;align-items:center}
.avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;border:1px solid var(--line)}
.profile-avatar{width:122px;height:122px;border-radius:50%;object-fit:cover;border:1px solid var(--line)}
.username{font-weight:700}.time{color:var(--muted);font-size:12px}
.profile-username{font-weight:700;font-size:18px}
.post-img{margin-top:8px;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.actions-row{display:flex;gap:18px;padding-top:10px;color:var(--muted);font-size:20px}
.actions-row button{background:none;border:0;cursor:pointer;color:var(--muted)}
.bottombar{position:fixed;bottom:0;left:0;right:0;background:var(--bg);border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-around;padding:10px 10px;z-index:10}
.nav-item{font-size:22px;color:var(--muted)}.nav-item.active{color:var(--brand);border-top:3px solid var(--accent);padding-top:7px}
.fab{background:var(--brand);color:#fff;border:0;width:48px;height:48px;border-radius:50%;font-size:28px;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,.25)}.fab:active{transform:scale(.98)}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center}.modal.hidden{display:none}
.modal-card{background:var(--bg);border-radius:12px;padding:16px;min-width:280px;border:1px solid var(--line)}.modal .btn{display:block;background:var(--brand);color:#fff;padding:10px;border-radius:10px;text-align:center;margin:10px 0}
.form{padding:12px 14px}.input{width:100%;padding:10px;border:1px solid var(--line);border-radius:10px;margin:8px 0;background:transparent;color:var(--fg)}
.btn-primary{background:var(--brand);color:#fff;border:0;padding:10px 14px;border-radius:10px}.btn-outline{background:transparent;color:var(--brand);border:1px solid var(--brand);padding:10px 14px;border-radius:10px}
.notice{margin:10px 14px;padding:12px;border-radius:10px;border:1px solid var(--line);background:rgba(0,0,0,.03)}.small{font-size:12px;color:var(--muted)}.medium{font-size:14px;color:var(--muted)}.center{text-align:center}
.grid{display:grid;gap:10px}.grid.cols-2{grid-template-columns:1fr 1fr}.grid.cols-3{grid-template-columns:1fr 1fr 1fr}

/* OG preview card */
.og-preview{display:block; overflow:hidden; border:1px solid var(--line); border-radius:12px; margin-top:10px}
.og-preview img{max-width:100%; height:auto; display:block; object-fit:cover}
.og-preview .og-body{padding:10px}
.og-preview .og-title{font-weight:700}
.og-preview, .og-preview *{word-wrap:anywhere; overflow-wrap:anywhere}

/* File icon buttons */
.file-buttons{display:flex; gap:10px; margin:8px 0}
.input-file{display:none}
.file-btn{display:inline-flex; align-items:center; gap:6px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; cursor:pointer; background:transparent; color:var(--fg)}
.file-name{
  margin-left:6px;
  opacity:.8;
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* Three-dots menu */
.kebab{background:none;border:0;font-size:18px;cursor:pointer;color:var(--muted)}
.kebab-menu{position:absolute; right:8px; top:40px; background:var(--bg); border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.2); display:none; min-width:160px; z-index:5}
.kebab-menu a, .kebab-menu form button{display:block; width:100%; text-align:left; padding:10px 12px; background:none; border:0; color:var(--fg)}
.kebab-wrap{position:relative; margin-left:auto}

/* Humanized time small */
.time .ago{font-variant-numeric:tabular-nums}

/* Action icons with counts */
.actions-row{align-items:center}
.action-btn{display:inline-flex; align-items:center; gap:6px; font-size:16px; color:var(--muted);}
.action-btn i{font-size:18px}
.action-btn.like.active i{color:#22c55e;} /* bright green */
.count{font-size:13px; color:var(--muted)}

/* Prevent side-scroll from long links in text */
.card .body a{word-break:break-word; overflow-wrap:anywhere}

/* Responsive media inside posts */
.post-img video, .post-img iframe { width:100%; height:auto; display:block; max-width:100%; }

/* Reels / Shorts style (small vertical videos) */
.post-img .reel-wrap{background:#000;border-radius:14px;overflow:hidden;max-width:520px;margin:0 auto;aspect-ratio:9/16;}
.post-img video.reel-video{width:100%;height:100%;display:block;object-fit:cover;background:#000;}
.post-img .reel-hint{font-size:12px;opacity:.8;margin-top:6px;text-align:center;}

/* Center avatars in Who to follow grid */
.grid.cols-3 .center .avatar{margin-left:auto;margin-right:auto;display:block}

.post-content { 
  white-space: pre-line;
}
.trophy-item { display:flex; flex-direction:column; align-items:center; text-align:center; padding:8px; }
.trophy-item img { display:block; width:90px; height:90px; object-fit:cover; border-radius:10px; border:1px solid var(--line); margin:0 auto; }
.trophy-item form { margin-top:8px; display:flex; justify-content:center; width:100%; }

a.btn, a.button { cursor: pointer; }

  .grid.suggest-grid { 
    gap: 10px; 
    grid-template-columns: repeat(3, 1fr); /* mobile: 2 columns */
  }
  @media (min-width: 768px) {
    .grid.suggest-grid {
      grid-template-columns: repeat(2, 1fr); /* desktop: 3 columns */
    }
  }
  

  /* Full-width hero media, tall on mobile, wider on desktop */
  .market-item .post-img{
    width:100%;
    aspect-ratio: 1 / 1;        /* big square on mobile */
    overflow:hidden;
    border-radius:12px;
    background:#000;            /* shows while image loads */
  }
  .market-item .post-img img.slide{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
  }
  @media (min-width: 960px){
    .market-item .post-img{ aspect-ratio: 16 / 10; } /* landscape on desktop */
  }
  .market-item .media-block{ margin-bottom:12px; }

/* ===== COMMENTS — full-width + tiny reply indent (FINAL) ===== */

/* Full-width rows and right-flush kebab */
.comment .meta{
  display:flex;
  align-items:flex-start !important;
  gap:10px;
  width:calc(100% + 30px);;
  position:relative;               /* anchor for kebab */
}
.comment .meta > .avatar{
  flex:0 0 auto;
  width:38px; height:38px; object-fit:cover; border-radius:50%;
}
.comment .meta > div{
  flex:1 1 auto !important;
  min-width:0 !important;          /* let text wrap instead of shrinking */
  padding-right:28px;              /* reserve room so text/actions don't sit under kebab */
}
.comment .meta > .kebab-wrap{
  position:absolute;
  right:0; top:0;                  /* kebab hugs the card’s right padding */
  margin-left:0 !important;
}

/* Replies: very small visual indent */
.comment > .meta > div > .replies{
  margin-left:4px !important;      /* tiny indent */
  border-left:0 !important;        /* kill any earlier borders */
  padding-left:0 !important;
  
}

/* Replies only: smaller avatar and tighter gap */
.comment.is-reply > .meta > .avatar{
  width:28px !important;
  height:28px !important;
  margin-left:-15px !important;     /* pulls avatar slightly left to cancel perceived indent */
  
}
.comment.is-reply > .meta{
  gap:8px !important;
}

/* Ensure nested comments take full width inside the content column */
.comment .replies .comment{
  margin-right:0 !important;
}

/* Mobile tweaks */
@media (max-width:640px){
  .comment.is-reply > .meta > .avatar{ width:26px !important; height:26px !important; }
  .comment > .meta > div > .replies{ margin-left:3px !important; }
}

/* Upload overlay */
#uploadOverlay {
  position: fixed; inset: 0;
  background: rgba(10,12,16,.75);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(2px);
}
#uploadOverlay.active { display: flex; }

.upload-box {
  width: min(480px, 92vw);
  padding: 22px;
  border-radius: 16px;
  background: #0b1220;
  color: #fff; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Spiral-ish loader */
.spinner {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 50%;
  border: 6px solid transparent;
  border-top-color: #fff;
  border-right-color: #fff;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 8px; background: rgba(255,255,255,.15);
  border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress > span { display:block; height:100%; width:0%;
  background: linear-gradient(90deg, #22c55e, #8b5cf6); transition: width .1s linear; }

.upload-note { font-size:.85rem; opacity:.85; margin-top: 8px; }

.comment-node .post-card { border:1px solid var(--line); border-radius:12px; background:var(--card); }
   .comment-node .actions .btn-link { color: var(--muted); text-decoration: underline; }
   .comment-node details > summary { cursor:pointer; }
  
.sighting-location{
  font-weight: 800;
  margin: 2px 0 8px;
}
.sighting-headline{
  font-weight: 800;
  font-size: 1.65rem;
  margin: 8px 0 8px;
  text-transform: capitalize;
}

.sighting-tag{
  margin-top: 6px;
  font-weight: 700;
  opacity: .9;
}
.char-counter{
  font-size: .9rem;
  opacity: .8;
  margin: 0 0 6px;
  text-align: right;
}
 .read-more{
  font-weight: 700;
  text-decoration: none;
}
.read-more:hover{
  text-decoration: underline;
}

/* Profile Groups grid — matches our grid look, no mobile overflow */
@media (min-width: 641px){
  .profile-groups-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
  }
}
@media (max-width: 640px){
  .profile-groups-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    margin:0; padding:0;
    max-width:100%;
  }
  .profile-groups-grid .card{ width:100%; max-width:100%; box-sizing:border-box; }
  .profile-groups-grid .card-row{ display:flex; gap:10px; min-width:0; }
  .profile-groups-grid .card-row > *{ min-width:0; }
  .profile-groups-grid .desc,
  .profile-groups-grid .h4{ overflow-wrap:anywhere; word-break:break-word; max-width:100%; }
  .profile-groups-grid img{ max-width:100%; height:auto; }
}

/* Header layout */
.groups-head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.groups-head .left{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* Segmented control (desktop/tablet) */
.seg{ display:inline-flex; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.seg a{ padding:6px 10px; text-decoration:none; }
.seg a.active{ background:var(--card); font-weight:600; }

/* Create button */
.create-btn{ display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }

/* Mobile: stack + full-width toggle and button */
@media (max-width:640px){
  .groups-head{ flex-direction:column; align-items:stretch; }
  .groups-head .left{ flex-direction:column; align-items:stretch; gap:6px; width:100%; }

  .groups-head .left .seg{
    display:flex;    /* full flex, not inline */
    width:100%;
  }
  .groups-head .left .seg a{
    flex:1 1 0;      /* each tab expands equally */
    text-align:center;
    padding:10px;    /* bigger tap target */
  }

  .groups-head .actions{ width:100%; }
  .groups-head .actions .create-btn{ width:100%; justify-content:center; }
}

/* Ultra-small phones: icon-only Create */
@media (max-width:360px){
  .groups-head .actions .create-btn .label{ display:none; }
  .groups-head .actions .create-btn{ gap:0; }
}

.comment-node .post-card.thread-card{ background:var(--thread-bg); color:var(--fg); }
.comment-node .post-card.reply-card { background:var(--reply-bg);  color:var(--fg); }

/* Keep borders/muted text consistent with your palette */
.post-card, .card, .chip { border-color:var(--line); }
.muted{ color:var(--muted); }


