/* Rondera! web app — Google link-only style, Material Design
 * Roboto. Light + dark. No card backgrounds, no shadows, no rounded corners
 * (except the search pill). Everything is text + hairlines. Only the R! mark
 * uses brand colors.
 */

:root {
  --gold:        #FBAD17;  /* R! mark only */
  --charcoal:    #36454F;  /* R! mark only */
  --ink:         #202124;  /* primary text — Google style */
  --ink-soft:    #5F6368;  /* secondary text */
  --ink-low:     #80868B;  /* hint / placeholder */
  --link:        #1A0DAB;  /* Google link blue (visit on hover) */
  --link-vis:    #681DA8;  /* visited link */
  --bg:          #FFFFFF;
  --bg-hover:    #F8F9FA;  /* hover row */
  --bg-active:   #E8F0FE;  /* selected row */
  --line:        #DADCE0;  /* hairline */
  --line-soft:   #F1F3F4;  /* very faint divider */
  --brand-h:     56px;
  --nav-h:       56px;
  --max:         720px;
  --pad:         20px;
}
html[data-theme="dark"] {
  --ink:         #E8EAED;
  --ink-soft:    #9AA0A6;
  --ink-low:     #5F6368;
  --link:        #8AB4F8;
  --link-vis:    #C58AF9;
  --bg:          #202124;
  --bg-hover:    #2D2E31;
  --bg-active:   #3C4043;
  --line:        #3C4043;
  --line-soft:   #292A2D;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-vis); }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; }

/* ── Brand bar (text-only, no logo) ─────────────────── */
.bar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  min-height: var(--brand-h);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex; align-items: center;
}
.bar-inner {
  width: 100%; max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex; align-items: center; gap: 12px;
}
.bar-home {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.3px;
  flex: 1; min-width: 0;
}
.bar-home:hover { text-decoration: none; }
.bar-home .bar-mark,
.bar-mark-link .bar-mark {
  width: 40px; height: 40px; border-radius: 8px;
  background: #FBAD17; color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; line-height: 1;
  letter-spacing: -0.5px;
  flex: 0 0 auto;
  text-decoration: none;
}
.bar-mark-link { display: inline-flex; text-decoration: none; }
.bar-mark-link:hover { text-decoration: none; }
.bar-mark-link:visited { color: #FFFFFF; }
.bar-home .bar-word { color: var(--ink); }
.bar-back {
  appearance: none; border: 0; background: transparent;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); border-radius: 50%;
}
.bar-back:hover { background: var(--bg-hover); }
.bar-titles { flex: 1; min-width: 0; }
.bar-t1 { font-size: 18px; font-weight: 400; color: var(--ink); }
.bar-t2 { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.bar-actions { display: inline-flex; align-items: center; gap: 2px; }
.icon-btn {
  appearance: none; border: 0; background: transparent;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); border-radius: 50%;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn.danger { color: var(--ink); }

/* ── Bottom nav (Google-style, text + thin icon) ────── */
.nav {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  font-size: 11px; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-top: 2px solid transparent;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); border-top-color: var(--ink); }

/* ── Content shell ─────────────────────────────────── */
#content {
  width: 100%;
  margin: 0 auto;
  max-width: var(--max);
  padding: 0 var(--pad) calc(var(--nav-h) + 16px);
  min-height: calc(100vh - var(--brand-h) - var(--nav-h));
}

/* ── About / empty states (text-only) ─────────────── */
.home {
  text-align: left;
  padding: 8px 0 16px;
}

/* ── Burundian flash colors (assigned per listing kind) ─ */
:root {
  --bi-red:    #CE1126;
  --bi-green:  #1EB53A;
  --bi-gold:   #FBAD17;
  --bi-white:  #FFFFFF;
  --bi-black:  #1A1A1A;
  --bi-blue:   #00A3E0;
  --bi-pink:   #E91E63;
  --bi-purple: #7B1FA2;
  --bi-orange: #FF6F00;
  --bi-teal:   #00ACC1;
}

/* ── Home quick menu — gold chip row ─ */
.home-quick {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -20px 12px;
  padding: 4px 20px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.home-quick::-webkit-scrollbar { display: none; }
.home-quick-item {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: var(--bi-gold);
  color: var(--bi-black);
  text-decoration: none;
  font-size: 12px; font-weight: 600;
  border-radius: 999px;
  scroll-snap-align: start;
  white-space: nowrap;
}
.home-quick-item:hover { background: #E0A015; text-decoration: none; }
.home-quick-item .ic { width: 14px; height: 14px; }

/* ── Home search bar (compact) ─ */
.home-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  margin: 0 0 12px;
}
.home-search:focus-within { box-shadow: 0 1px 6px rgba(32,33,36,0.18); border-color: transparent; }
.home-search .ic { color: var(--ink-soft); }
.home-search input {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  font: inherit; outline: none; padding: 2px 0;
}
.home-search input::placeholder { color: var(--ink-low); }

/* ── Home dense marketplace grid (cluttered, colorful) ─ */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}
@media (min-width: 720px) {
  .home-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
@media (min-width: 1000px) {
  .home-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
}
.home-count {
  font-size: 11px; font-weight: 700;
  background: var(--bi-gold); color: var(--charcoal);
  padding: 2px 8px; border-radius: 999px;
  letter-spacing: 0.3px;
}
.sec-categories { scroll-margin-top: 72px; }
.home-card {
  appearance: none; border: 0; background: var(--bg);
  text-align: left; color: var(--ink);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: transform 80ms, box-shadow 80ms;
}
.home-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); text-decoration: none; }
.home-card-hero {
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}
.home-card-hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 12px);
  pointer-events: none;
}
/* Category icon as a large background "preview image" */
.home-card-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.home-card-art svg {
  width: 65%; height: 65%;
  color: rgba(255, 255, 255, 0.22);
  fill: currentColor;
}
/* R! brand mark badge (top-right) */
.home-card-mark {
  position: absolute; top: 8px; right: 8px;
  background: #FFFFFF;
  color: var(--charcoal);
  font-size: 11px; font-weight: 900;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: -0.5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
/* Initial letter (centered, large) */
.home-card-initial {
  position: relative; z-index: 1;
  font-size: 36px; font-weight: 900;
  line-height: 1; letter-spacing: -1px;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
  pointer-events: none;
}
@media (min-width: 720px) { .home-card-initial { font-size: 48px; } }
.home-card-body {
  padding: 8px 10px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.home-card-title {
  font-size: 12px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.home-card-sub {
  font-size: 10px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-card-price {
  font-size: 11px; font-weight: 700; color: var(--bi-red);
  margin-top: 2px;
}

/* Per-kind Burundian flash colors (assigned in JS) */
.bi-red    { background: var(--bi-red); }
.bi-green  { background: var(--bi-green); }
.bi-gold   { background: var(--bi-gold); color: var(--bi-black); }
.bi-blue   { background: var(--bi-blue); }
.bi-pink   { background: var(--bi-pink); }
.bi-purple { background: var(--bi-purple); }
.bi-orange { background: var(--bi-orange); }
.bi-teal   { background: var(--bi-teal); }
.bi-black  { background: var(--bi-black); }
.btn-ghost {
  appearance: none; border: 0; background: var(--bg);
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  padding: 8px 16px; border-radius: 4px;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }
.btn-text {
  appearance: none; border: 0; background: transparent;
  color: var(--link); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 4px;
}
.btn-text:hover { background: var(--bg-hover); text-decoration: underline; }
.btn-text:visited { color: var(--link); }
.btn-dark {
  appearance: none; border: 0; background: var(--ink);
  color: var(--bg); font-size: 13px; font-weight: 500;
  padding: 8px 16px; border-radius: 4px;
}
.btn-dark:hover { opacity: 0.9; }

/* ── Section (text-only, like Google "People also ask") ─ */
.sec { margin: 20px 0; }
.sec-head {
  margin: 0 0 12px;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
}
.sec-h {
  margin: 0;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-soft);
}

/* ── List of text-link rows (Google results style) ───── */
.list { display: flex; flex-direction: column; }
.row {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.row:hover { background: var(--bg-hover); }
.row-title {
  font-size: 16px;
  color: var(--link);
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
}
.row:visited .row-title { color: var(--link-vis); }
.row:hover .row-title { text-decoration: underline; }
.row-sub {
  font-size: 12px; color: var(--ink-low);
  margin-top: 2px;
}
.row-meta {
  font-size: 12px; color: var(--ink-soft);
  margin-top: 4px;
}
.row-chev {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.row-chev .row-chev-icon { color: var(--ink-low); }

/* ── Category row (Google "more" item) ─────────────── */
.cat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  background: transparent; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; cursor: pointer;
}
.cat-row:hover { background: var(--bg-hover); }
.cat-row .ic { color: var(--ink-soft); flex: 0 0 auto; }
.cat-row .name { flex: 1; font-size: 15px; color: var(--link); }
.cat-row:hover .name { text-decoration: underline; }
.cat-row:visited .name { color: var(--link-vis); }
.cat-row .count { font-size: 12px; color: var(--ink-low); }

/* ── Detail page (Google knowledge-panel style) ─────── */
.detail { padding: 16px 0; }
.detail-breadcrumb {
  font-size: 12px; color: var(--ink-soft);
  margin-bottom: 6px;
}
.detail-title {
  margin: 0 0 6px;
  font-size: 24px; font-weight: 400; line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.detail-where {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 4px;
}
.detail-verified {
  display: inline-block;
  font-size: 12px; color: var(--ink-soft);
  margin-bottom: 16px;
}
.detail-verified::before { content: "✓ "; color: var(--ink); font-weight: 700; }

.detail-price {
  font-size: 18px; font-weight: 400; color: var(--ink);
  margin: 8px 0 16px;
}

.detail-section {
  margin: 24px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-section h2 {
  margin: 0 0 12px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-soft);
}
.detail-section p {
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.6;
}

.action-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 16px 0;
}
.action-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  background: var(--bg);
}
.action-link:hover { background: var(--bg-hover); text-decoration: none; }
.action-link:visited { color: var(--ink); }

/* ── Comments (text-only, like forum) ─────────────── */
.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.comment:last-child { border-bottom: 0; }
.comment-meta {
  font-size: 12px; color: var(--ink-soft);
  margin-bottom: 4px;
}
.comment-meta strong { color: var(--ink); font-weight: 500; }
.comment-text { color: var(--ink); line-height: 1.5; }
.comment-form {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.comment-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font: inherit; resize: vertical; min-height: 60px;
}
.comment-form textarea:focus { outline: 2px solid var(--link); border-color: transparent; }
.comment-form-row { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.comment-cta {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 13px;
}

/* ── Chat (text-only) ───────────────────────────────── */
.chat { padding: 16px 0; }
.chat-hint {
  font-size: 12px; color: var(--ink-soft);
  margin-bottom: 12px;
}
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 13px;
}
.user-pill .name { flex: 1; color: var(--ink); }
.user-pill .btn-text { flex: 0 0 auto; }
.chat-list { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; max-height: 50vh; overflow-y: auto; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 80%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap; word-wrap: break-word;
}
.bubble-row.mine .bubble {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.bubble-meta { font-size: 11px; opacity: 0.7; margin-bottom: 2px; }
.chat-form {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.chat-form input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg); color: var(--ink);
  font: inherit; outline: none;
}
.chat-form input:focus { border-color: var(--ink); }
.chat-locked {
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-soft);
}

/* ── Settings (Google settings-page style) ────────── */
.settings-h {
  margin: 24px 0 8px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ink-soft);
}
.seg {
  display: inline-flex; background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}
.seg-btn {
  appearance: none; border: 0; background: transparent;
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: var(--ink); color: var(--bg); }

.row-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.row-link:hover { background: var(--bg-hover); }
.row-link-icon { color: var(--ink-soft); flex: 0 0 auto; }
.row-link-body { flex: 1; min-width: 0; }
.row-link-body strong { display: block; font-weight: 500; color: var(--ink); }
.row-link-body .small { color: var(--ink-soft); font-size: 12px; margin-top: 2px; }
.row-link-chev { color: var(--ink-low); flex: 0 0 auto; }
.row-link:visited { color: var(--ink); }

/* ── Post form (text inputs, no card) ─────────────── */
.post-form {
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 0;
}
.post-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; font-weight: 500; color: var(--ink-soft);
}
.post-form input, .post-form textarea {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink); font: inherit;
  outline: none;
}
.post-form input:focus, .post-form textarea:focus {
  border-color: var(--ink);
}
.post-form-submit { margin-top: 8px; }

/* ── Search bar (sub-pages) ───────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  margin: 16px 0;
}
.search-bar:focus-within { box-shadow: 0 1px 6px rgba(32,33,36,0.18); border-color: transparent; }
.search-bar .ic { color: var(--ink-soft); }
.search-bar input {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  font: inherit; outline: none; padding: 2px 0;
}

/* ── About / empty states (text-only) ─────────────── */
.about-mark {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 56px; font-weight: 500;
  letter-spacing: -1.5px;
  color: var(--charcoal);
}
.about-mark .bang { color: var(--gold); }
[data-theme="dark"] .about-mark { color: var(--gold); }
.about-tagline {
  font-size: 14px; color: var(--ink-soft);
  margin: 0 0 32px;
}
.about-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.about-row:last-child { border-bottom: 0; }
.about-row strong { display: block; color: var(--ink); font-weight: 500; }
.about-row .small { color: var(--ink-soft); font-size: 12px; margin-top: 2px; }

.empty {
  padding: 32px 16px; text-align: center;
  color: var(--ink-soft); font-size: 14px;
}

/* ── Toast ─────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg);
  padding: 8px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 150ms, transform 150ms;
  z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ───────────────────────────────────── */
@media (min-width: 720px) {
  :root { --brand-h: 64px; --max: 1140px; }
  .home { padding: 32px 0 20px; }
  .home-mark { font-size: 56px; }  /* still used on About screen */
  .home-quick-item { font-size: 11px; }
  .action-list .action-link { padding: 8px 18px; font-size: 14px; }
  .nav a { font-size: 12px; padding: 10px 4px; }
  .nav { max-width: var(--max); margin: 0 auto; }
  .nav a { padding: 8px 0; }
  .bar-home { font-size: 22px; }
  .bar-home .bar-mark,
  .bar-mark-link .bar-mark { width: 44px; height: 44px; font-size: 20px; border-radius: 10px; }
  .detail-title { font-size: 28px; }
}
@media (min-width: 1000px) {
  .nav a { padding: 8px 0; font-size: 12px; }
}
