/* RateMyMelons — denser, squared-off green theme. No rounded corners, compact spacing, small type. */

:root {
  --green-dark:  #00461a;
  --green:       #006D2B;
  --green-mid:   #2f8f3e;
  --green-med:   #8FC542;
  --green-light: #B9DC8A;
  --green-pale:  #e7f0da;
  --accent:      #cc1111;
  --ink:         #16210f;
  --muted:       #5f6b57;
  --line:        #b7c9a4;
  --line-soft:   #d7e2c6;
  --card:        #ffffff;
  --page:        #d9e2cd;
  --wrap:        1180px;
  --fs:          13px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: var(--fs)/1.4 "Segoe UI", Tahoma, Arial, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 6px; }
h1 { font-size: 17px; } h2 { font-size: 14px; } h3 { font-size: 13px; }

/* ---------- SFW/NSFW top bar ---------- */
.sfwbar { background: #03260c; color: #bcd8b1; font-size: 11px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 3px 12px; }
.sfwswitch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.sfwswitch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sfwswitch .track { width: 34px; height: 18px; background: #777; position: relative; display: inline-block; border: 1px solid #04340f; transition: background .15s; }
.sfwswitch .knob { position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; background: #fff; transition: left .15s; }
.sfwswitch input:checked + .track { background: var(--green-med); }
.sfwswitch input:checked + .track .knob { left: 17px; }
.sfwswitch .onoff { min-width: 20px; font-weight: 700; }

/* SFW blur: applied on the fly, no server storage. Not a hard block (image is still delivered). */
body.sfw .thumb img,
body.sfw .detail-img,
body.sfw .swipe-img,
body.sfw .myimg .pic img,
body.sfw .dtile img { filter: blur(20px); }

/* Top-Melons drawer thumbnails: 2 per row, score under, tap to enlarge */
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dtile { margin: 0; border: 1px solid var(--line); background: #fff; }
.dtile img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; cursor: zoom-in; }
.dtile figcaption { padding: 2px 5px; font-size: 11px; line-height: 1.3; }
.dtile figcaption strong { color: var(--green-dark); }
.dtile.enlarged { grid-column: 1 / -1; border-color: var(--green-med); }
.dtile.enlarged img { aspect-ratio: auto; height: auto; cursor: zoom-out; }

/* ---------- masthead ---------- */
.masthead { background: repeating-linear-gradient(135deg, #05421a, #05421a 8px, #063f19 8px, #063f19 16px); color: #fff; border-bottom: 3px solid var(--green-med); }
.masthead a { color: #fff; }
.tagline { background: #03310f; color: #a9cf9a; font-size: 11px; text-align: center; padding: 3px 10px; border-bottom: 1px solid #0a4a1f; }
.bar { max-width: var(--wrap); margin: 0 auto; padding: 6px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; }
.brand .logo { height: 40px; width: auto; display: block; }
.bar .search { display: flex; order: 3; }
.menu-btn { order: 4; }
.sfwswitch-wrap { order: 2; margin: 0 auto; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.sfwlab { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #cfe9c6; }
.bar .search input { border: 1px solid var(--green-med); border-right: 0; padding: 6px 9px; min-width: 150px; font-size: 12px; background: #f6faf0; }
.bar .search button { border: 1px solid var(--green-med); background: var(--green-med); color: #03310f; font-weight: 700; padding: 6px 12px; cursor: pointer; font-size: 12px; }
.menu-btn { border: 1px solid var(--green-med); background: #0a4a1f; color: #fff; font-weight: 700; padding: 6px 12px; cursor: pointer; font-size: 12px; font-family: inherit; letter-spacing: .3px; }
.menu-btn:hover { background: var(--green); }

/* ---------- collapsible nav (closed by default) ---------- */
.nav { background: #0a4a1f; border-top: 1px solid #0d5a26; display: none; }
.nav.open { display: block; }
.nav-inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; }
.nav a, .nav .dropbtn { display: block; color: #dcecd0; padding: 8px 13px; font-weight: 600; font-size: 12.5px; background: none; border: 0; border-right: 1px solid #0d5a26; cursor: pointer; font-family: inherit; }
.nav a:hover, .nav .dropbtn:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav .spacer { margin-left: auto; }
/* the classic little golden stars around each menu item */
.nav a::before, .nav .dropbtn::before,
.nav a::after,  .nav .dropbtn::after {
  content: ''; display: inline-block; width: 11px; height: 11px; vertical-align: -1px;
  background: url('/images/star.png?v=7') center/contain no-repeat;
}
.nav a::before, .nav .dropbtn::before { margin-right: 5px; }
.nav a::after,  .nav .dropbtn::after  { margin-left: 5px; }
.nav .spacer::before, .nav .spacer::after { content: none; }
.nav .badge { background: var(--accent); color: #fff; font-size: 10px; padding: 0 5px; margin-left: 3px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 190px; z-index: 40; background: #0a4a1f; border: 1px solid #0d5a26; box-shadow: 0 4px 12px rgba(0,0,0,.3); display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { border-right: 0; border-bottom: 1px solid #0d5a26; }
.dropdown-menu a.sub { padding-left: 26px; font-weight: 500; color: #b9d8ab; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin: 10px auto; padding: 0 10px; }
.layout { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) { .layout.has-side { grid-template-columns: 1fr 260px; } }
main { min-width: 0; }

/* ---------- content boxes (double border, like the classic look) ---------- */
.card { background: var(--card); border: 1px solid var(--green-med); box-shadow: inset 0 0 0 1px #fff, 0 1px 0 rgba(0,0,0,.08); margin-bottom: 10px; }
.card > h1, .card > h2 { background: linear-gradient(180deg, var(--green-light), #a9d17a); color: var(--green-dark); font-size: 13px; margin: 0; padding: 5px 9px; border-bottom: 1px solid var(--green-med); text-transform: uppercase; letter-spacing: .4px; }
.card .body { padding: 9px; }
.side .card > h2 { font-size: 12px; }

/* ---------- homepage intro block ---------- */
.intro > h2 { text-align: center; }
.intro .warn { color: var(--accent); font-weight: 700; }
.introtext { line-height: 1.5; }
.introtext p { margin: 0 0 8px; }
.introtoggle { display: none; margin-top: 4px; padding: 4px 12px; font: inherit; cursor: pointer; background: var(--green-pale); color: var(--green-dark); border: 1px solid var(--green-med); font-weight: 700; }
@media (max-width: 760px) {
  .introtext.clamped { max-height: 4.7em; overflow: hidden; position: relative; }
  .introtext.clamped::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.7em; background: linear-gradient(rgba(255,255,255,0), #fff); }
  .introtoggle.show { display: inline-block; }
}

/* ---------- day-grouped feed ---------- */
.dayhead { background: var(--green-dark); color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 4px 9px; margin: 12px 0 6px; }
.body > .dayhead:first-child { margin-top: 0; }

/* ---------- slide-in "Top Melons" drawer (mobile); static sidebar on desktop ---------- */
.drawer-close, .drawer-btn, .drawer-backdrop { display: none; }
@media (max-width: 899px) {
  .drawer {
    position: fixed; top: 0; right: 0; height: 100%; width: 300px; max-width: 86vw; z-index: 60;
    background: var(--page); box-shadow: -3px 0 14px rgba(0,0,0,.35);
    transform: translateX(103%); transition: transform .25s ease; overflow-y: auto; padding: 10px;
  }
  .drawer.open { transform: translateX(0); }
  .drawer-close { display: block; margin: 0 0 8px auto; width: 34px; height: 34px; line-height: 1;
    border: 1px solid var(--green-med); background: #fff; color: var(--green-dark); font-size: 22px; cursor: pointer; }
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
  .drawer-backdrop.open { display: block; }
  .drawer-btn { display: block; position: fixed; right: 12px; bottom: 12px; z-index: 50;
    background: var(--green); color: #fff; border: 1px solid var(--green-dark); font-weight: 700;
    padding: 10px 15px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); font-size: 13px; }
}

/* ---------- melon grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.tile { background: #fff; border: 1px solid var(--line); display: block; }
.tile:hover { border-color: var(--accent); }
.tile .thumb { aspect-ratio: 1/1; background: #dfe6d4; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .meta { padding: 3px 5px; font-size: 11.5px; line-height: 1.25; }
.tile .meta .score { font-weight: 800; color: var(--green-dark); }
.tile .meta .by { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ranking list */
.ranklist { list-style: none; margin: 0; padding: 0; }
.ranklist li { display: flex; gap: 6px; padding: 3px 0; border-bottom: 1px dotted var(--line); font-size: 12.5px; }
.ranklist li .n { color: var(--muted); width: 18px; text-align: right; }
.ranklist li .sc { margin-left: auto; font-weight: 700; color: var(--green-dark); }

/* ---------- detail ---------- */
.detail-img { border: 1px solid var(--line); background: #fff; }

/* Tinder-style swipe-to-rate on the photo */
.swipe { position: relative; user-select: none; -webkit-user-select: none; touch-action: pan-y; width: max-content; max-width: 100%; }
.swipe-img { transition: transform .06s ease-out; cursor: grab; touch-action: pan-y; -webkit-user-drag: none; }
.swipe.dragging { cursor: grabbing; }
.swipe.dragging .swipe-img { transition: none; }
.swipe-num { position: absolute; top: 10px; left: 50%; margin-left: -46px; width: 92px; text-align: center; z-index: 5; display: none;
  font-size: 44px; line-height: 1.1; font-weight: 800; color: #fff; background: rgba(0,70,26,.85); border: 2px solid #fff;
  padding: 2px 0; text-shadow: 0 2px 5px rgba(0,0,0,.5); pointer-events: none; }
.swipe.dragging .swipe-num { display: block; }
.swipe-num.low { background: rgba(175,22,22,.88); }
.swipe-hint { text-align: center; font-size: 11px; color: var(--muted); margin: 4px 0 0; max-width: 520px; }

/* swipe rater */
.rater { user-select: none; margin: 10px 0 4px; }
.rater-value { font-size: 40px; font-weight: 800; color: var(--green-dark); text-align: center; height: 46px; line-height: 46px; }
.rater-value.dim { color: var(--muted); }
.rater-track { position: relative; height: 46px; border: 1px solid var(--green); background: linear-gradient(90deg, #e2b0b0 0%, #efe6b6 50%, #b7dc8a 100%); cursor: ew-resize; touch-action: none; overflow: hidden; }
.rater-ticks { position: absolute; inset: 0; display: flex; }
.rater-ticks span { flex: 1; border-right: 1px solid rgba(0,0,0,.10); font-size: 9px; color: rgba(0,0,0,.45); text-align: center; padding-top: 2px; }
.rater-ticks span:last-child { border-right: 0; }
.rater-thumb { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; background: var(--green-dark); box-shadow: 0 0 0 1px #fff; left: 50%; }
.rater-hint { text-align: center; font-size: 11px; color: var(--muted); margin-top: 3px; }

.rate-fallback { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rate-fallback button { border: 1px solid var(--green-med); background: var(--green-pale); color: var(--green-dark); width: 34px; height: 32px; font-weight: 700; cursor: pointer; }
.rate-fallback button:hover { background: var(--green-med); }

/* account / auth helpers */
.card.narrow { max-width: 470px; margin: 16px auto; }
.myimg { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.myimg .item { border: 1px solid var(--line); background: #fff; }
.myimg .item .pic { aspect-ratio: 1/1; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: #dfe6d4; }
.myimg .item .pic img { width: 100%; height: 100%; object-fit: cover; }
.myimg .item .act { padding: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.pill { font-size: 11px; padding: 1px 7px; border: 1px solid var(--green-med); background: var(--green-pale); color: var(--green-dark); text-transform: capitalize; }
.threadlist { list-style: none; margin: 0; padding: 0; }
.threadlist li { padding: 8px 2px; border-bottom: 1px solid var(--line-soft); }
.threadlist li.unread { background: #f2f8ea; font-weight: 600; }
.msg { border: 1px solid var(--line-soft); padding: 8px 10px; margin-bottom: 8px; background: #fbfdf8; }
.msg.mine { background: #eef5e2; }
.msg .head { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

/* ---------- forms ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date],
select, textarea { width: 100%; max-width: 380px; padding: 6px 8px; border: 1px solid var(--line); font: inherit; background: #fff; }
textarea { max-width: 100%; }
label { display: block; font-weight: 600; margin: 8px 0 3px; }
.btn, button.btn { display: inline-block; background: var(--green); color: #fff; border: 1px solid var(--green-dark); padding: 7px 14px; font-weight: 700; cursor: pointer; font-size: 12.5px; font-family: inherit; }
.btn:hover { background: var(--green-dark); }
.btn.secondary { background: var(--green-pale); color: var(--green-dark); border-color: var(--green-med); }

/* ---------- comments / misc ---------- */
.comment { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.comment .who { font-weight: 700; color: var(--green-dark); }
.comment .when { color: var(--muted); font-size: 11px; margin-left: 5px; }
.status { background: #e2f0d6; border: 1px solid var(--green-med); color: var(--green-dark); padding: 6px 10px; margin: 0 0 8px; }
.errors { background: #f7dede; border: 1px solid #d99; color: #922; padding: 6px 10px 6px 24px; margin: 0 0 8px; }
.muted { color: var(--muted); }

nav[role=navigation] { margin-top: 8px; }
.pagination { display: flex; flex-wrap: wrap; gap: 3px; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-block; padding: 4px 9px; border: 1px solid var(--line); background: #fff; color: var(--green-dark); font-size: 12px; }
.pagination .active span { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- footer ---------- */
.foot { background: #03310f; color: #9cc08c; margin-top: 14px; border-top: 3px solid var(--green-med); }
.foot .inner { max-width: var(--wrap); margin: 0 auto; padding: 12px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: #cfe4c2; }
.foot .lang { margin-right: 12px; }
.foot .lang a { display: inline-block; padding: 1px 6px; border: 1px solid #2f7a45; margin-left: 3px; font-size: 11px; }
.foot .lang a.on { background: var(--green-med); color: #04340f; border-color: var(--green-med); }

@media (max-width: 760px) {
  .bar { flex-wrap: wrap; }
  .menu-btn { order: 3; }
  .bar .search { order: 4; width: 100%; margin: 5px 0 0; }
  .bar .search input { flex: 1; min-width: 0; }
  .nav-inner { flex-direction: column; }
  .nav a, .nav .dropbtn { border-right: 0; border-bottom: 1px solid #0d5a26; width: 100%; text-align: left; }
  .nav .spacer { display: none; }
  .dropdown-menu { position: static; box-shadow: none; }
}


/* ---- forum: classic IPB board layout in the site palette ---- */
.fboard .crumbs { margin: 4px 0 6px; font-size: 12px; }
.fboard .crumbs a { color: var(--green-dark); font-weight: 700; }
.fboard .topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.fboard .topbar .actions { display: flex; gap: 6px; }
.fboard .small { font-size: 11px; }
.borderwrap { background: #fff; border: 1px solid var(--green-dark); margin-bottom: 10px; }
.borderwrap .body { padding: 9px; }
.maintitle { background: linear-gradient(180deg, var(--green-med), #7fb43a); color: #fff; font-weight: 700; font-size: 12.5px; padding: 6px 9px; border-bottom: 1px solid var(--green-dark); display: flex; justify-content: space-between; gap: 8px; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.maintitle .desc { font-weight: 400; opacity: .92; font-size: 11.5px; }
.subtitle-bar { background: var(--green-pale); color: var(--green-dark); font-size: 11px; padding: 4px 9px; border-bottom: 1px solid #cfe4c2; display: flex; gap: 6px; align-items: center; }
.subtitle-bar.lock { background: #f7dede; border-color: #e2b0b0; color: #922; }
.subtitle-bar form { display: inline-flex; gap: 6px; }
.ftable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ftable th { background: var(--green-pale); color: var(--green-dark); text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--green-med); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.ftable td { padding: 6px 8px; border-bottom: 1px solid #d9e2cd; vertical-align: middle; }
.ftable tr.alt td { background: #f6faf0; }
.ftable tr:hover td { background: #eef5e2; }
.ftable .ico { width: 24px; text-align: center; padding-right: 0; }
.ftable .ico img { vertical-align: middle; }
.ftable .num { text-align: center; width: 64px; white-space: nowrap; color: var(--muted); }
.ftable .starter { width: 130px; white-space: nowrap; }
.ftable .lastcol { width: 150px; white-space: nowrap; font-size: 11.5px; }
.ftable .ftitle { font-weight: 700; color: var(--green-dark); }
.ftable .small { font-size: 11px; }
.ftable .mobile-only { display: none; }
.tag { display: inline-block; background: var(--green-med); color: var(--green-dark); font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 1px 5px; margin-right: 3px; vertical-align: middle; }
.tag.lock { background: #e2b0b0; color: #922; }
/* post */
.ipost { border-bottom: 1px solid #d9e2cd; }
.ipost-head { display: grid; grid-template-columns: 160px 1fr; background: #dcecd0; border-bottom: 1px solid #cfe4c2; }
.ipost-head .iname { padding: 5px 8px; font-weight: 700; color: var(--green-dark); border-right: 1px solid #fff; overflow-wrap: anywhere; }
.ipost-head .imeta { padding: 5px 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.ipost-head .imeta a { color: var(--green-dark); font-weight: 700; }
.ipost-main { display: grid; grid-template-columns: 160px 1fr; }
.ipost-main .iauthor { padding: 8px; font-size: 11px; color: var(--muted); background: #f2f8ea; border-right: 1px solid #fff; line-height: 1.6; }
.iauthor .igroup { color: var(--green-dark); font-weight: 700; }
.pips { display: block; margin: 3px 0 1px; line-height: 0; }
.pips i { display: inline-block; width: 12px; height: 12px; margin-right: 1px; background: url('/images/star.png?v=7') no-repeat center / 12px 12px; }
.iauthor .irank { color: var(--ink); }
.ipost-text { padding: 9px 10px 12px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; min-height: 72px; }
.ipost-text a { color: #1a5fb4; }
.ipost-foot { display: grid; grid-template-columns: 160px 1fr; background: #dcecd0; border-top: 1px solid #cfe4c2; }
.ipost-foot .l, .ipost-foot .r { padding: 4px 8px; }
.ipost-foot .l { border-right: 1px solid #fff; }
.ipost-foot .r { display: flex; justify-content: flex-end; gap: 6px; }
.ipost-foot .r form { display: inline; }
.pbtn { display: inline-block; background: linear-gradient(180deg, #fff, #e2f0d6); border: 1px solid var(--green-med); color: var(--green-dark); font-size: 10px; font-weight: 700; padding: 1px 7px; text-transform: uppercase; letter-spacing: .3px; text-decoration: none; cursor: pointer; font-family: inherit; line-height: 1.6; }
.pbtn:hover { background: var(--green-pale); }
.pbtn.danger { color: #922; border-color: #e2b0b0; }
.catend { height: 6px; background: var(--green-med); }
.replybox textarea { width: 100%; box-sizing: border-box; }
/* post content */
.emo { vertical-align: middle; max-height: 24px; }
.fquote { margin: 6px 0 8px; }
.fquote-top { background: #effcd7; border: 1px dotted #6b7f5b; border-bottom: 0; border-left: 4px solid var(--green-med); color: #1e3a12; font-weight: 700; font-size: 11px; padding: 3px 6px; }
.fquote-main { background: #f6faf0; border: 1px dotted #6b7f5b; border-top: 0; border-left: 4px solid var(--green-med); padding: 6px 8px; font-size: 12.5px; }
.fquote .fquote { margin: 4px 0; }
.fcode { background: #f4f4f4; border: 1px solid #ccc; padding: 6px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; }
@media (max-width: 640px) {
  .ipost-head, .ipost-main, .ipost-foot { grid-template-columns: 1fr; }
  .ipost-head .iname, .ipost-foot .l { border-right: 0; }
  .ipost-head .iname { border-bottom: 1px solid #fff; }
  .ipost-main .iauthor { border-right: 0; border-bottom: 1px solid #e2f0d6; display: flex; flex-wrap: wrap; gap: 2px 10px; line-height: 1.4; padding: 5px 8px; }
  .ipost-main .iauthor br { display: none; }
  .ipost-text { min-height: 0; }
  .ipost-foot .l { display: none; }
  .ftable .num, .ftable .lastcol, .ftable .starter { display: none; }
  .ftable .mobile-only { display: block; }
  .maintitle .desc { display: none; }
}

/* ---- pagination (custom view, no framework CSS) ---- */
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.pagination { margin: 0; }
.pagination li { display: inline-block; }
.pagination a, .pagination span { line-height: 1.2; min-width: 12px; text-align: center; }
.pagination a:hover { background: var(--green-pale); text-decoration: none; }
.pagination .disabled span { color: #a0aa98; background: #f6faf0; }
.pager-info { font-size: 11px; }

/* ---- combined login / sign-up page ---- */
.access { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 760px) { .access { grid-template-columns: 1fr; } }
.access .card { margin-bottom: 0; }
/* ---- post header: rank next to the name; compact author line ---- */
.ipost-head .iname { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ipost-head .iname .irank { font-weight: 400; font-size: 11px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.pips { display: inline-block; margin: 0; line-height: 0; vertical-align: middle; }
.iauthor .stats span { white-space: nowrap; }
@media (max-width: 640px) {
  .ipost-main .iauthor .stats { display: flex; flex-wrap: wrap; gap: 2px 10px; }
}
/* ---- member name dropdown ---- */
.uname { position: relative; display: inline-block; }
.uname > button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--green-dark); cursor: pointer; }
.uname > button:after { content: " ▾"; font-size: 9px; color: var(--muted); }
.uname-menu { display: none; position: absolute; left: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--green-med); box-shadow: 0 2px 6px rgba(0,0,0,.15); min-width: 160px; }
.uname.open .uname-menu { display: block; }
.uname-menu a { display: block; padding: 6px 10px; font-size: 12px; font-weight: 400; color: var(--ink); border-bottom: 1px solid #eef5e2; }
.uname-menu a:hover { background: var(--green-pale); text-decoration: none; }
/* ---- smiley picker ---- */
.smilies { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 3px; margin: 4px 0 6px; }
.smilies .smiley { background: #fff; border: 1px solid #d9e2cd; padding: 1px 3px; cursor: pointer; line-height: 0; }
.smilies .smiley:hover { border-color: var(--green-med); background: var(--green-pale); }
.smilies .smiley img { max-height: 20px; }
.smilies-all { display: flex; flex-wrap: wrap; gap: 2px 3px; width: 100%; margin-top: 3px; padding-top: 3px; border-top: 1px dashed #d9e2cd; }
.linkbtn.small { font-size: 11px; color: var(--green-dark); }
/* ---- forum: visibility tags ---- */
.tag.staff { background: #e2b0b0; color: #922; }
/* ---- member profile ---- */
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; margin-bottom: 8px; }
.profile-meta b { color: var(--green-dark); }

/* ---- forum user strip + PM bodies ---- */
.userbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--green-pale); border: 1px solid #cfe4c2; padding: 4px 8px; margin-bottom: 8px; font-size: 12px; }
.userbar .badge { margin-left: 3px; }
.ipost-text.pm { padding: 4px 0 0; min-height: 0; font-size: 12.5px; }

/* ---- post rows swapped: green head = name+rank | member stats; light row = date | post no.; body full width ---- */
.ipost-head .iauthor { padding: 5px 8px; font-size: 11px; color: var(--muted); background: transparent; border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; line-height: 1.4; }
.ipost-head .iauthor .igroup { color: var(--green-dark); font-weight: 700; }
.ipost > .imeta { background: #f2f8ea; border-bottom: 1px solid #e2f0d6; padding: 4px 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.ipost > .imeta a { color: var(--green-dark); font-weight: 700; }
.ipost > .ipost-text { min-height: 56px; }
.ipost-foot { display: flex; justify-content: space-between; align-items: center; }
.ipost-foot .l { border-right: 0; }
@media (max-width: 640px) { .ipost-foot .l { display: block; } }

/* ---- pictures in posts: attachments + external images ---- */
.ipost-text img.fimg { max-width: 100%; height: auto; max-height: 640px; display: inline-block; margin: 4px 6px 4px 0; border: 1px solid #d9e2cd; background: #fff; vertical-align: top; }
.fattachments { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #d9e2cd; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: flex-start; }
.fattachments img.fimg { max-height: 220px; }
.fattach-file { display: inline-block; font-size: 12px; margin: 2px 6px 2px 0; }
body.sfw .ipost-text img.fimg, body.sfw .fattachments img.fimg { filter: blur(20px); }

/* ---- mobile post head: one flowing line (name, rank, posts, joined); member no. only in the name dropdown ---- */
.uname-info { display: block; padding: 5px 10px; font-size: 11px; color: var(--muted); border-bottom: 1px solid #eef5e2; background: #f6faf0; }
@media (max-width: 640px) {
  .ipost-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding: 4px 8px; }
  .ipost-head .iname { padding: 0; border: 0; display: inline-flex; gap: 8px; }
  .ipost-head .iauthor { padding: 0; gap: 0 10px; }
  .ipost-head .iauthor .imno { display: none; }
}

/* ---- picture protection (deterrent): no drag, no text/touch selection, no iOS long-press callout ---- */
img:not(.emo):not(.logo), .thumb, .detail-img, .swipe, .myimg .pic, .dtile, .fattach, .fattachments {
  -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
img:not(.emo):not(.logo) { pointer-events: auto; }

/* ---- tile links (thumb + username) ---- */
.tile .thumb { display: block; }
.tile .meta a { color: inherit; text-decoration: none; }
.tile .meta a.by:hover { color: var(--green-dark); text-decoration: underline; }

/* ---- camera button (bottom-left, mirrors the Top-Melons button) ---- */
.cam-btn { position: fixed; left: 12px; bottom: 12px; z-index: 50; display: inline-flex; align-items: center; gap: 7px;
  background: var(--green); color: #fff; border: 1px solid var(--green-dark); font-weight: 700; font-family: inherit;
  padding: 9px 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); font-size: 13px; text-decoration: none; }
.cam-btn:hover { background: var(--green-dark); color: #fff; text-decoration: none; }
.cam-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cam-form input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.cam-busy { position: fixed; inset: 0; z-index: 90; background: rgba(3,49,15,.82); color: #fff; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; font-weight: 700; }
.cam-busy.open { display: flex; }
.cam-busy .spin { width: 34px; height: 34px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: camspin .8s linear infinite; }
@keyframes camspin { to { transform: rotate(360deg); } }
@media (max-width: 899px) { .cam-btn { padding: 10px 13px; } }

/* ---- round camera button (icon only) ---- */
.cam-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
.cam-btn svg { width: 24px; height: 24px; }
@media (max-width: 899px) { .cam-btn { padding: 0; width: 50px; height: 50px; } }

/* ---- in-page camera ---- */
.cam-modal { position: fixed; inset: 0; z-index: 95; background: #000; display: flex; align-items: center; justify-content: center; }
.cam-modal[hidden] { display: none; }
.cam-modal video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-controls { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 34px; }
.cam-shoot { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; box-shadow: 0 0 0 3px rgba(0,0,0,.4); }
.cam-shoot:active { background: #fff; }
.cam-ctl { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(0,0,0,.45); color: #fff; font-size: 20px; cursor: pointer; }
body.cam-open { overflow: hidden; }

/* ---- mailbox ---- */
.mailbox { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: start; }
.mail-nav { display: flex; flex-direction: column; gap: 4px; }
.mail-nav .btn { text-align: center; margin-bottom: 6px; }
.mail-folder { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); background: #fff; color: var(--green-dark); font-weight: 700; text-decoration: none; }
.mail-folder.on, .mail-folder:hover { background: var(--green-pale); border-color: var(--green-med); text-decoration: none; }
.mail-folder .badge { margin-left: auto; }
.mailtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mailtable td { padding: 7px 8px; border-bottom: 1px solid #e2eadb; vertical-align: middle; }
.mailtable tr:hover td { background: #f6faf0; }
.mailtable tr.unread td { background: #fff; }
.mailtable tr.unread .who, .mailtable tr.unread .subj .s { font-weight: 800; color: var(--ink); }
.mailtable .dot { width: 14px; padding-right: 0; }
.mailtable .udot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.mailtable .who { width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mailtable .subj a { color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.mailtable .subj .s { color: var(--green-dark); font-weight: 600; }
.mailtable .clip { width: 22px; text-align: center; }
.mailtable .when { width: 92px; text-align: right; white-space: nowrap; color: var(--muted); font-size: 11px; }
.mail { border: 1px solid #d9e2cd; margin-bottom: 8px; background: #fff; }
.mail.mine { background: #fbfdf8; }
.mail-head { display: flex; justify-content: space-between; gap: 8px; padding: 5px 9px; background: var(--green-pale); border-bottom: 1px solid #d9e2cd; font-size: 12px; }
.mail-head .from a { font-weight: 700; color: var(--green-dark); }
.mail .ipost-text.pm { padding: 8px 10px 10px; }
.mail-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.mail-attachments img.fimg { max-height: 160px; max-width: 100%; border: 1px solid #d9e2cd; }
.attach-label { display: block; margin: 6px 0; font-weight: 600; font-size: 12px; }
.attach-label input[type=file] { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; }
@media (max-width: 700px) {
  .mailbox { grid-template-columns: 1fr; }
  .mail-nav { flex-direction: row; flex-wrap: wrap; }
  .mail-nav .btn { margin: 0; }
  .mail-folder { padding: 6px 9px; }
  .mailtable .who { width: auto; max-width: 34vw; }
  .mailtable .when { width: auto; }
  .mailtable .subj a { max-width: 44vw; }
}
