/* freecycle.lk — green for recycling, saffron + maroon from the Sri Lankan flag */
:root {
  --green: #0b7a53; --green-d: #065a3c; --green-l: #e3f4ec;
  --saffron: #f2a516; --saffron-d: #c98200; --saffron-l: #fff3d6;
  --maroon: #8d153a; --maroon-l: #fbe7ed;
  --ink: #1d2521; --muted: #66726b; --line: #e4e2da; --bg: #f7f5ef; --card: #fff;
  --r: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Iskoola Pota", "Noto Sans Tamil", "Latha", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); padding-bottom: 76px; }
.lang-si, .lang-ta { line-height: 1.65; }
.lang-ta h1, .lang-ta h2 { letter-spacing: -.01em; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2em 0 .5em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .7em; }
h3 { font-size: 1.05rem; margin: .3em 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 16px; padding-bottom: 32px; }
.narrow { max-width: 640px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 180px; }
.err { color: var(--maroon); }
.hp { position: absolute; left: -9999px; }

/* Top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--saffron-d); }
.topnav { display: none; margin-left: auto; align-items: center; gap: 4px; }
.topnav a { color: var(--ink); padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.topnav a.on, .topnav a:hover { background: var(--green-l); text-decoration: none; }
.topnav a.btn { color: #fff; }
.langs { display: flex; margin-left: auto; background: var(--bg); border-radius: 999px; padding: 3px; }
.langs button { border: 0; background: none; font: inherit; font-size: .8rem; padding: 5px 9px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.langs button.on { background: #fff; color: var(--green-d); box-shadow: var(--shadow); }
@media (min-width: 860px) {
  .topnav { display: flex; }
  .langs { margin-left: 8px; }
  body { padding-bottom: 0; }
  .bottomnav { display: none !important; }
}

/* Bottom nav (phones) */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--muted); font-weight: 600; gap: 1px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottomnav a span { font-size: 1.35rem; line-height: 1.2; position: relative; }
.bottomnav a.on { color: var(--green); }
.bottomnav a:hover { text-decoration: none; }
.bottomnav .post-fab span { background: var(--saffron); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-top: -22px;
  font-size: 1.7rem; font-weight: 700; box-shadow: 0 4px 12px rgba(242,165,22,.45); border: 3px solid #fff; }
.dot { position: absolute; top: -4px; right: -10px; background: var(--maroon); color: #fff; font-style: normal; font-size: .65rem; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.badge { background: var(--maroon); color: #fff; font-size: .72rem; border-radius: 999px; padding: 1px 7px; font-style: normal; font-weight: 700; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; background: var(--green); color: #fff;
  font: inherit; font-weight: 700; padding: 11px 18px; cursor: pointer; text-align: center; transition: transform .05s, background .15s; }
.btn:hover { background: var(--green-d); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--saffron); color: #2a1d00; }
.btn-accent:hover { background: var(--saffron-d); color: #fff; }
.btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line:hover { background: var(--bg); }
.btn-danger { background: var(--maroon); }
.btn-danger:hover { background: #6c0f2c; }
.btn-white { background: #fff; color: var(--green-d); }
.btn-white:hover { background: var(--saffron-l); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.25); }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5b; }
.btn-sm { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.btn-xs { padding: 4px 9px; font-size: .78rem; border-radius: 8px; }
.btn-big { padding: 14px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* Forms */
input, select, textarea { font: inherit; width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; color: var(--ink); }
a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--green); }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.lbl { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; }
fieldset { border: 0; background: #fff; border-radius: var(--r); padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
legend { font-weight: 800; font-size: 1.05rem; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
legend + * { clear: both; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--green); color: #fff; border-radius: 50%; font-size: .85rem; margin-right: 6px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 14px; border-radius: 999px; background: var(--bg); border: 1.5px solid var(--line); font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--green-l); border-color: var(--green); color: var(--green-d); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--green-l); }
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.type-opt { margin: 0; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; }
.type-opt span { display: block; padding: 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); height: 100%; }
.type-opt b { display: block; font-size: 1.05rem; }
.type-opt small { color: var(--muted); font-weight: 500; }
.type-opt input:checked + span { border-color: var(--green); background: var(--green-l); }
.postform[data-type=wanted] .when-not-wanted, .postform:not([data-type=sale]) .when-sale { display: none; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg); margin: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.add { border: 2px dashed #c9c6ba; display: grid; place-items: center; text-align: center; color: var(--muted); cursor: pointer; font-size: .85rem; }
.ph.add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ph.add span { font-size: .85rem; }
.ph .rm { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; padding: 4px; display: flex; gap: 4px; align-items: center; justify-content: center; }
.ph .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; }
.ph.existing:has(input:checked) img { opacity: .3; }

/* Flash */
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-weight: 600; }
.flash-ok { background: var(--green-l); color: var(--green-d); }
.flash-err { background: var(--maroon-l); color: var(--maroon); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--green-d), var(--green) 60%, #1d9468); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(242,165,22,.35), transparent 70%); }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--saffron) 0 50%, var(--maroon) 50%); }
.hero-in { padding: 36px 16px 40px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 0 0 .3em; letter-spacing: -.02em; }
.hero-sub { font-size: 1.05rem; opacity: .92; max-width: 640px; margin: 0 0 20px; }
.search { display: grid; grid-template-columns: 1fr; gap: 8px; background: #fff; padding: 8px; border-radius: 16px; max-width: 760px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.search input, .search select { border: 0; background: var(--bg); }
@media (min-width: 640px) { .search { grid-template-columns: 2fr 1.2fr auto; } }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 22px; }
.impact { display: flex; gap: 26px; flex-wrap: wrap; }
.impact div { display: flex; flex-direction: column; max-width: 11rem; }
.impact b { font-size: 1.6rem; line-height: 1.1; color: var(--saffron); }
.impact span { font-size: .85rem; opacity: .9; }

/* Categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.cat { background: #fff; border-radius: var(--r); padding: 12px 8px; text-align: center; color: var(--ink); font-size: .82rem; font-weight: 600; box-shadow: var(--shadow); line-height: 1.3; }
.cat span { display: block; font-size: 1.7rem; margin-bottom: 4px; }
.cat:hover { text-decoration: none; background: var(--green-l); }
@media (max-width: 520px) { .cats { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 96px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; } .cat { scroll-snap-align: start; } }

/* Item grid */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sec-head a { font-weight: 600; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.card-img { aspect-ratio: 4/3; background: var(--bg); position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.6rem; background: linear-gradient(135deg, var(--green-l), var(--saffron-l)); }
.card-body { padding: 10px 12px 12px; }
.card h3 { font-size: .98rem; margin: 6px 0 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card p { margin: 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; letter-spacing: .03em; }
.tag-lg { font-size: .85rem; padding: 4px 10px; }
.b-free { background: var(--green-l); color: var(--green-d); }
.b-wanted { background: var(--saffron-l); color: #8a5a00; }
.b-sale { background: var(--maroon-l); color: var(--maroon); }
.status { position: absolute; top: 8px; left: 8px; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; color: #fff; }
.s-reserved { background: var(--saffron-d); }
.s-done { background: #555; }
.empty { text-align: center; padding: 40px 16px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }

/* How it works: numbered steps, same look as the launch flyer */
.how { background: var(--green-l); border-radius: var(--r); padding: 16px; margin-bottom: 8px; }
.how h2 { margin: 0 0 12px; color: var(--green-d); }
.how .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 860px) { .how .steps { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.how .steps li { display: flex; align-items: center; gap: 14px; background: #fff; padding: 14px 16px; border-radius: var(--r); box-shadow: var(--shadow); }
.how .steps li > div { flex: 1; min-width: 0; }
.how .num { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #f9c74f; color: var(--green-d); display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; }
.how h3 { margin: 0 0 2px; color: var(--green-d); font-weight: 800; }
.how p { margin: 0; color: var(--muted); font-size: .95rem; }
.how .steps span { flex: none; font-size: 2rem; line-height: 1; }
.why { margin-top: 28px; background: var(--saffron-l); border-radius: var(--r); padding: 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; border-left: 6px solid var(--maroon); }
.why div { flex: 1 1 320px; }
.why h2 { margin-top: 0; }
.why p { margin: 0; }

/* Browse filters */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.filters input[type=search] { grid-column: 1 / -1; }
.filters .btn { grid-column: 1 / -1; }
.filters .chips { grid-column: 1 / -1; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1fr auto; } .filters input[type=search], .filters .btn { grid-column: auto; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: .88rem; box-shadow: inset 0 0 0 1.5px var(--line); }
.chip.on { background: var(--green); color: #fff; box-shadow: none; }
.chip:hover { text-decoration: none; }
.h-list { font-size: 1.3rem; margin-top: 14px; }
.pager { display: flex; gap: 14px; justify-content: center; align-items: center; margin: 24px 0; }

/* Item page */
.crumbs { margin-bottom: 10px; }
.item { display: grid; gap: 20px; }
@media (min-width: 860px) { .item { grid-template-columns: 1.15fr 1fr; align-items: start; } .item-media { position: sticky; top: 96px; } }
.item-media { position: relative; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r); background: #111; aspect-ratio: 4/3; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery.noimg.big { font-size: 5rem; background: linear-gradient(135deg, var(--green-l), var(--saffron-l)); }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #cfccc0; }
.dots i.on { background: var(--green); }
.status-banner { position: absolute; top: 12px; left: 12px; color: #fff; font-weight: 800; padding: 6px 12px; border-radius: 8px; }
.item-info h1 { margin-top: 8px; }
.facts { list-style: none; padding: 0; margin: 14px 0; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--muted); }
.facts b { text-align: right; }
.desc { white-space: normal; margin: 14px 0; }
.contact-box, .owner-box { background: #fff; border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin: 16px 0; border-top: 4px solid var(--green); }
.owner-box { border-top-color: var(--saffron); }
.owner-box h3 { margin-top: 0; }
.owner-box .row { margin-top: 10px; }
.owner-box form { margin: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.qr { border: 1.5px solid var(--green); background: var(--green-l); color: var(--green-d); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-align: left; }
.qr:hover { background: var(--green); color: #fff; }
.qr-pickup { border-color: var(--saffron-d); background: var(--saffron-l); color: #7a4f00; }
.ask { display: flex; gap: 8px; }
.contact-alt { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.status-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.seller { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); color: var(--ink); }
.seller:hover { text-decoration: none; background: var(--green-l); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; background: linear-gradient(135deg, var(--green), var(--saffron)); }
.online { color: var(--green); font-weight: 600; }
.item-actions { margin: 12px 0; }
.tip { background: var(--saffron-l); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }

/* Auth */
.auth { max-width: 420px; margin: 10px auto; background: #fff; padding: 22px; border-radius: var(--r); box-shadow: var(--shadow); }

/* Account */
.profile-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 2px 0; }
.profile-head .logout { margin-left: auto; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills span { background: var(--green-l); color: var(--green-d); border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 16px 0; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--green-d); border-color: var(--green); }
.tabs a:hover { text-decoration: none; }
.mylist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mylist li { display: flex; gap: 12px; background: #fff; border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); align-items: center; }
.ml-img { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; flex: none; background: var(--bg); }
.ml-img img { width: 100%; height: 100%; object-fit: cover; }
.ml-img .noimg { font-size: 1.8rem; }
.ml-main { flex: 1; min-width: 0; }
.ml-main .status-btns { margin-top: 6px; }

/* Inbox */
.inbox { list-style: none; padding: 0; margin: 0; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.inbox li + li { border-top: 1px solid var(--line); }
.inbox a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: var(--ink); }
.inbox a:hover { background: var(--bg); text-decoration: none; }
.inbox img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.inbox .avatar { width: 52px; height: 52px; border-radius: 10px; }
.ib-main { flex: 1; min-width: 0; }
.ib-last { display: block; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.inbox .unread .ib-last { color: var(--ink); font-weight: 700; }

/* Chat */
.chat-page { padding-top: 0; padding-bottom: 0; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 76px - 70px); max-width: 760px; margin: 0 auto; background: #fff; }
@media (min-width: 860px) { .chat { height: calc(100dvh - 84px - 32px); margin-top: 16px; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; } }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.back { font-size: 1.4rem; padding: 4px 8px; color: var(--ink); }
.chat-item { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); }
.chat-item:hover { text-decoration: none; }
.chat-item img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.chat-item span { min-width: 0; display: flex; flex-direction: column; }
.chat-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item small { color: var(--muted); }
.icon-btn { font-size: 1.3rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); }
.icon-btn:hover { text-decoration: none; background: var(--green-l); }
.seller-bar { display: flex; gap: 6px; padding: 8px 10px; background: var(--saffron-l); flex-wrap: wrap; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: #f3f1ea; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg time { font-size: .68rem; color: var(--muted); margin: 2px 6px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 16px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.msg.them .bubble { border-bottom-left-radius: 5px; }
.msg.sys { align-self: center; max-width: 92%; text-align: center; font-size: .8rem; color: var(--muted); background: rgba(255,255,255,.7); padding: 6px 12px; border-radius: 10px; display: block; }
.msg.sys time { display: inline; }
.pickup-card { background: #fff; border-radius: 14px; padding: 12px 14px; border: 2px solid var(--saffron); min-width: 220px; }
.pickup-card.p-accepted { border-color: var(--green); }
.pickup-card.p-declined { border-color: #bbb; opacity: .8; }
.pc-when { font-size: 1.05rem; font-weight: 700; margin: 4px 0; }
.pc-btns { margin-top: 8px; }
.pc-state { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.composer { border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; }
.quick-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick-row .qr { white-space: nowrap; padding: 6px 12px; font-size: .84rem; }
.send-row { display: flex; gap: 8px; align-items: flex-end; }
.send-row textarea { resize: none; max-height: 120px; border-radius: 20px; padding: 10px 14px; }
.send-row .btn { border-radius: 50%; width: 46px; height: 46px; padding: 0; font-size: 1.2rem; flex: none; }
.pickup-form { background: var(--saffron-l); border-radius: 12px; padding: 12px; margin-top: 8px; }
.pickup-form label { margin-bottom: 8px; }
body:has(.chat) .footer { display: none; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stats div { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stats b { font-size: 1.6rem; color: var(--green); }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); font-size: .9rem; }
.tbl th, .tbl td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl td form { margin: 2px 0; }
.tbl input { width: auto; padding: 4px 8px; }

/* Pages */
.prose { background: #fff; padding: 22px; border-radius: var(--r); box-shadow: var(--shadow); }
.prose li { margin-bottom: 8px; }
.ticks { padding-left: 1.2em; }

/* Footer */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 12px 0; margin-top: 24px; font-size: .85rem; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 6px 20px; flex-wrap: wrap; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer nav a { color: var(--ink); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 50; font-weight: 600; }
.bottomnav a.post-fab { overflow: visible; }
.gallery.noimg { display: grid; place-items: center; }
@media (min-width: 960px) { .cats { grid-template-columns: repeat(6, 1fr); } }
.topbar-in { height: 76px; }
.logo-img { height: 64px; width: auto; display: block; }
@media (min-width: 860px) { .topbar-in { height: 84px; } .topbar .logo-img { height: 72px; } }

/* ---------- Near me + map picker ---------- */
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--green); font-weight: 600; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn[disabled] { opacity: .6; }
.hero-near { margin: 10px 0 0; }
.hero-near .linkbtn { color: #fff; }
.nearbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 0 4px; }
.nearbar .near-where { margin: 0; flex: 1 1 100%; }
.btn-near { font-weight: 700; }
.card .dist { color: var(--green-d); }

/* "Recently given" examples (home page, new site only). Not links, always labelled. */
.sample-note { background: var(--saffron-l); border-radius: 10px; padding: 8px 12px; margin: -4px 0 12px; font-size: .9rem; color: #6b4a00; }
.card.sample { cursor: default; }
.card.sample:hover { transform: none; box-shadow: var(--shadow); }
.card.sample .card-img img { object-fit: contain; }
.sample-flag { position: absolute; top: 8px; left: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; color: #fff; background: #4a5560; }
.b-sample { background: #e8ebee; color: #3d4852; border: 1px dashed #8a96a1; }
.b-given { background: var(--green-l); color: var(--green-d); }

.locfield { margin: 4px 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.locfield p { margin: 0; flex: 1 1 100%; }
.item-loc { margin: -4px 0 12px; }
.minimap { height: 220px; border-radius: var(--r); margin-top: 8px; z-index: 0; }
.item-loc [data-area-note] { margin: 4px 0 0; }

html.picker-open, html.picker-open body { overflow: hidden; }
.picker { position: fixed; inset: 0; z-index: 100; background: #fff; display: none; flex-direction: column; }
.picker.open { display: flex; }
.picker-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.picker-x { border: 0; background: var(--bg); width: 38px; height: 38px; border-radius: 50%; font-size: 1.05rem; cursor: pointer; }
.picker-search { position: relative; padding: 10px 12px 6px; }
.picker-search input { width: 100%; }
.picker-results { position: absolute; left: 12px; right: 12px; top: 100%; z-index: 1000; list-style: none; margin: 0; padding: 4px 0; background: #fff;
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 50vh; overflow: auto; }
.picker-results li { padding: 10px 14px; cursor: pointer; }
.picker-results li:hover, .picker-results li:focus { background: var(--green-l); outline: 0; }
.picker-results li.none { color: var(--muted); cursor: default; }
.picker-msg { margin: 0 12px 6px; padding: 8px 12px; border-radius: 10px; background: var(--saffron-l); font-size: .9rem; }
.picker-map { position: relative; flex: 1; min-height: 200px; background: var(--green-l); }
.picker-canvas { position: absolute; inset: 0; }
/* Fixed pin in the middle: the map moves under it (like ride-hailing apps). Its tip marks the centre. */
.picker-pin { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -36px 0 0 -15px; z-index: 500; pointer-events: none;
  background: var(--maroon); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); transform-origin: 50% 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.picker-pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff; border-radius: 50%; }
.picker-gps { position: absolute; left: 10px; bottom: 22px; z-index: 600; box-shadow: var(--shadow); }
.picker-foot { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.picker-place { margin: 0 0 8px; font-weight: 600; min-height: 1.5em; }
.picker.nomap .picker-canvas, .picker.nomap .picker-pin { display: none; }
.picker.nomap .picker-map { flex: 0 0 auto; min-height: 64px; background: none; }
.picker.nomap .picker-gps { left: 12px; bottom: auto; top: 8px; }
@media (min-width: 700px) {
  .picker { inset: 5vh auto auto 50%; width: 640px; height: 90vh; transform: translateX(-50%); border-radius: var(--r); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
  html.picker-open body::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }
}
.msg-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
.msg-card.is-read { opacity: .7; }

/* AI helpers: photo suggestions, translations */
.ai-note { background: var(--saffron-l); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.ai-note.busy { animation: aipulse 1.4s ease-in-out infinite; }
.ai-note.warn { background: var(--maroon-l); color: var(--maroon); }
@keyframes aipulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ai-note.busy { animation: none; } }
.tr-note { margin-top: 6px; }
.msg .bubble .tr { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,.08); font-size: .9em; opacity: .85; }

/* ---------- Alerts, badges, ratings, voice posting ---------- */
.alertbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0; }
.alertbar form { margin: 0; }
.card-box { background: #fff; border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin: 14px 0; }
.card-box h3 { margin-top: 0; }
.wa-box { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.alert-list { list-style: none; padding: 0; margin: 0 0 14px; }
.alert-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.alert-list li.paused { opacity: .65; }
.alert-list form { margin: 0; flex: none; }
.btn-fb { background: #1877f2; color: #fff; }
.btn-fb:hover { background: #0f5fc7; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge-pill { background: var(--saffron-l); color: #6b4700; border-radius: 999px; padding: 3px 11px; font-size: .85rem; font-weight: 700; }
.badge-pill i { font-style: normal; }
.trusted { color: var(--green-d); background: var(--green-l); border-radius: 999px; padding: 1px 8px; font-weight: 700; white-space: nowrap; }
h1 .trusted { font-size: .8rem; vertical-align: middle; }
.impact-share { background: #fff; border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); margin: 14px 0; max-width: 640px; }
.impact-share img { width: 100%; height: auto; border-radius: 10px; display: block; }
.impact-share .row { margin-top: 8px; flex-wrap: wrap; }
.reviews { list-style: none; padding: 0; }
.reviews li { background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.rate-card { margin: 8px 10px; background: var(--green-l); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rate-card.done { font-weight: 600; }
.rate-card small { font-weight: 400; }
.rate-btns { display: flex; gap: 8px; }
.rate-btns button { flex: 1; min-height: 48px; font: inherit; font-size: 1.05rem; font-weight: 700; padding: 10px; border-radius: 12px;
  background: #fff; color: var(--ink); border: 2px solid var(--line); cursor: pointer; }
.rate-btns button:hover { border-color: var(--green); }
.rate-btns button:focus-visible { outline: 3px solid var(--saffron); }
.rate-note { display: flex; gap: 8px; }
.rate-note input { flex: 1; min-width: 0; }
.rate-nudge { max-width: 640px; margin: 12px auto; box-shadow: var(--shadow); }
.home > .rate-nudge { margin: 12px; }
@media (min-width: 680px) { .home > .rate-nudge { margin: 12px auto; } }
.rate-later { margin: -2px 0 0; text-align: right; }
.rate-later button { background: none; border: 0; padding: 4px; color: var(--muted, #667); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.given-who { align-items: flex-end; }
.voice { background: var(--saffron-l); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.voice-btn { font-size: 1.05rem; padding: 14px; }
.voice-btn.rec { background: var(--maroon); color: #fff; box-shadow: none; animation: fc-pulse 1.4s infinite; }
.voice-lang { margin: 10px 0 4px; }
.voice [data-voice-status] { margin: 6px 0 0; }
@keyframes fc-pulse { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .voice-btn.rec { animation: none; } }

/* Founding giver notice (home + post page) and badge */
.founding { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--saffron-l); border: 1px solid #f5d48a; border-left: 5px solid var(--saffron); border-radius: 12px; padding: 12px 14px; margin: 0 0 18px; color: #4d3500; }
.founding > div { flex: 1 1 260px; line-height: 1.45; }
.founding-icon { font-size: 1.8rem; line-height: 1; }
.founding-left { display: inline-block; background: #fff; color: var(--saffron-d); border-radius: 999px; padding: 1px 10px; margin-top: 2px; white-space: nowrap; }
.founding .btn { flex: 0 0 auto; }
.founding-pill { color: #6b4700; background: var(--saffron-l); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
