/* ============================================================
   TSENA — Marketplace Madagascar
   Mix dense (Leboncoin) + palette/typo moderne
   ============================================================ */

:root {
  --primary: #2d4eea;
  --primary-hover: #1e3acc;
  --primary-light: #e8edff;
  --accent: #ff5a36;
  --accent-hover: #e94a28;
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-soft: #f0f2f8;
  --text: #15192c;
  --text-secondary: #4a5168;
  --text-muted: #8590a6;
  --border: #e3e6ee;
  --border-strong: #c8cee0;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(20, 25, 50, 0.04);
  --shadow: 0 2px 8px rgba(20, 25, 50, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 25, 50, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 25, 50, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --container: 1400px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* ===== Header ===== */
.site-header { background: var(--bg-elev); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-top { display: flex; align-items: center; gap: 24px; padding: 14px 16px; max-width: var(--container); margin: 0 auto; }
.logo { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; white-space: nowrap; }
.logo .accent { color: var(--accent); }
.search-wrap { flex: 1; display: flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: 720px; }
.search-wrap input[type="search"] { flex: 1; border: 0; background: transparent; padding: 11px 14px; font-size: 14px; outline: none; }
.search-wrap select { border: 0; background: transparent; border-left: 1px solid var(--border); padding: 0 10px; font-size: 13px; color: var(--text-secondary); outline: none; cursor: pointer; max-width: 150px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3af'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px; }
.search-wrap button { background: var(--primary); color: #fff; border: 0; padding: 0 22px; font-weight: 600; font-size: 14px; transition: background 0.15s; }
.search-wrap button:hover { background: var(--primary-hover); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-publish { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-weight: 700; font-size: 13px; border: 0; white-space: nowrap; transition: background 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-publish:hover { background: var(--accent-hover); text-decoration: none; }
.icon-btn { background: transparent; border: 0; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }

/* Cat bar */
.cat-bar { background: var(--bg-elev); border-bottom: 1px solid var(--border); overflow-x: auto; }
.cat-bar-inner { display: flex; gap: 4px; padding: 6px 16px; max-width: var(--container); margin: 0 auto; white-space: nowrap; }
.cat-bar-inner a { padding: 8px 14px; font-size: 13px; color: var(--text-secondary); font-weight: 500; border-radius: var(--radius-sm); transition: all 0.15s; }
.cat-bar-inner a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.cat-bar-inner a.active { background: var(--primary); color: #fff; }

/* Main */
/* Boost — À la une */
.listing-card.featured { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.15); }
.badge-featured { position: absolute; bottom: 8px; left: 8px; background: rgba(245,158,11,.92); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .3px; pointer-events: none; }

.main-layout { max-width: var(--container); margin: 16px auto; display: grid; grid-template-columns: 240px 1fr 320px; gap: 16px; padding: 0 16px; }
@media (max-width: 1200px) { .main-layout { grid-template-columns: 220px 1fr; } .layout-right { display: none; } }
@media (max-width: 900px) { .main-layout { grid-template-columns: 1fr; } .layout-left { display: none; } }

/* Left sidebar */
.layout-left { position: sticky; top: 116px; align-self: start; max-height: calc(100vh - 130px); overflow-y: auto; }
.sidebar-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.sidebar-card h3 { padding: 12px 14px; margin: 0; font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list > li > a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--border); transition: all 0.1s; }
.cat-list > li:last-child > a { border-bottom: 0; }
.cat-list > li > a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.cat-list > li > a.active { background: var(--primary); color: #fff; }
.cat-list .cat-icon { font-size: 16px; line-height: 1; }
.cat-list .cat-count { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg-soft); padding: 2px 6px; border-radius: 10px; }
.cat-list > li > a.active .cat-count { background: rgba(255,255,255,0.25); color: #fff; }
.cat-list .subcat { list-style: none; padding: 6px 0 6px 38px; margin: 0; display: none; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.cat-list .subcat.open { display: block; }
.cat-list .subcat a { display: block; padding: 5px 8px; font-size: 12.5px; color: var(--text-secondary); }
.cat-list .subcat a:hover { color: var(--primary); text-decoration: none; }

/* Right sidebar / ads */
.layout-right { position: sticky; top: 116px; align-self: start; }
.ad-placeholder { background: linear-gradient(135deg, #e7ecff 0%, #f5e8ff 100%); border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--text-muted); font-size: 12px; font-weight: 500; text-align: center; padding: 16px; margin-bottom: 12px; }
.ad-placeholder::before { content: 'PUB'; font-size: 9px; background: var(--text-muted); color: #fff; padding: 2px 6px; border-radius: 3px; margin-bottom: 8px; letter-spacing: 1px; }
.ad-300x250 { height: 250px; }
.ad-300x600 { height: 600px; }
.ad-728x90  { height: 90px; width: 100%; }

/* Filters */
.filter-bar { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.filter-bar .filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.filter-bar input, .filter-bar select { border: 1.5px solid var(--border); background: var(--bg,#fff); padding: 6px 10px; border-radius: 8px; font-size: 13px; outline: none; color: var(--text); min-width: 0; width: 90px; transition: border-color .15s, box-shadow .15s; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.filter-bar select#city { width: 148px; }
.filter-bar .sort-select { width: auto; min-width: 140px; }
.filter-bar button.apply { background: var(--primary); color: #fff; border: 0; padding: 7px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background .15s, transform .1s; align-self: flex-end; }
.filter-bar button.apply:hover { background: var(--primary-hover); }
.filter-bar button.apply:active { transform: scale(.97); }
.filter-bar button.reset { background: transparent; border: 1.5px solid var(--border); padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background .15s, border-color .15s, color .15s; align-self: flex-end; }
.filter-bar button.reset:hover { background: #fff1f2; border-color: #fca5a5; color: #dc2626; }
.dyn-filters { display: none; flex-wrap: wrap; gap: 10px; align-items: flex-end; width: 100%; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.dyn-filters.show { display: flex; }
.dyn-cat-badge { display: inline-flex; align-items: center; gap: 5px; background: #eef2ff; color: var(--primary); border-radius: 20px; padding: 4px 12px 4px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; align-self: flex-end; white-space: nowrap; }
.dyn-cat-badge .badge-icon { font-size: 14px; }
.dyn-filters .checks { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-end; }
.check-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 20px; border: 1.5px solid var(--border); background: #fff; font-size: 12.5px; color: var(--text); cursor: pointer; font-weight: 500; transition: all .15s; user-select: none; }
.check-chip input[type="checkbox"] { display: none; }
.check-chip:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.check-chip:not(:has(input:checked)):hover { border-color: var(--primary); color: var(--primary); }

/* Grid */
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 4px; }
.results-header .count { font-size: 14px; color: var(--text); font-weight: 600; }
.results-header .count span { color: var(--text-muted); font-weight: 400; }
.listings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .listings-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .listings-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .listings-grid { grid-template-columns: 1fr; } }

.listing-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.18s; position: relative; display: flex; flex-direction: column; }
.listing-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.listing-card a { display: flex; flex-direction: column; color: inherit; text-decoration: none; height: 100%; }
.listing-img { aspect-ratio: 1 / 1; background: linear-gradient(135deg, #f0f2f8 0%, #e3e6ee 100%); position: relative; overflow: hidden; }
.listing-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-img .placeholder-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 48px; opacity: 0.5; }
.listing-img .pro-badge { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 4px; letter-spacing: 0.5px; }
.listing-img .fav-btn { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; background: rgba(255,255,255,0.92); border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
.listing-img .fav-btn:hover { color: var(--accent); transform: scale(1.1); }
.listing-img .fav-btn.active { color: var(--accent); }
.listing-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.listing-price { font-weight: 800; font-size: 15px; color: var(--text); margin-bottom: 4px; line-height: 1.2; }
.listing-price .currency { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.listing-title { font-size: 13px; color: var(--text); font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; margin-bottom: 6px; }
.listing-meta { display: flex; flex-direction: column; gap: 5px; margin-top: auto; font-size: 11.5px; color: var(--text-muted); }
.card-seller-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border); }
.card-seller-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--primary, #6366f1); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.card-seller-name { font-size: 11.5px; color: var(--text-secondary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-meta .tag { display: inline-block; background: var(--bg-soft); padding: 2px 7px; border-radius: 4px; font-weight: 500; color: var(--text-secondary); font-size: 11px; align-self: flex-start; }
.listing-meta .meta-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.listing-meta .loc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-ad { background: linear-gradient(135deg, #fff5f0 0%, #ffeae0 100%); border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; font-weight: 600; flex-direction: column; padding: 16px; min-height: 220px; }
.grid-ad::before { content: 'PUB'; font-size: 9px; background: var(--text-muted); color: #fff; padding: 2px 6px; border-radius: 3px; margin-bottom: 8px; letter-spacing: 1px; }
.banner-mid { margin: 20px 0; }

/* Footer */
.site-footer { background: #15192c; color: #b3bbd1; margin-top: 48px; padding: 40px 0 20px; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 32px; }
@media (max-width: 800px) { .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
@media (max-width: 480px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: 13px; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 14px 0; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #b3bbd1; font-size: 13px; transition: color 0.15s; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { width: 36px; height: 36px; background: rgba(255,255,255,0.06); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; text-decoration: none; transition: background 0.15s; }
.footer-social a:hover { background: var(--primary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: #8590a6; }
.footer-bottom .logo-small { font-size: 18px; font-weight: 800; color: #fff; }
.footer-bottom .logo-small .accent { color: var(--accent); }

/* Forms */
.form-page { max-width: 480px; margin: 32px auto; padding: 0 16px; }
.form-page.wide { max-width: 760px; }
.form-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.form-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.form-card .subtitle { color: var(--text-secondary); margin: 0 0 24px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea { width: 100%; border: 1px solid var(--border); background: #fff; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; outline: none; color: var(--text); font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group .hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-section { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 24px; display: none; }
.form-section.show { display: block; }
.form-section h3 { font-size: 14px; font-weight: 700; margin: 0 0 14px; color: var(--primary); text-transform: uppercase; letter-spacing: 0.3px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 14px; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-primary { width: 100%; background: var(--primary); color: #fff; border: 0; padding: 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: background 0.15s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; }
.btn-secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.btn-secondary:hover { background: var(--border); }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert.error { background: #fee; color: var(--danger); border: 1px solid #fcc; }
.alert.success { background: #d4f4dd; color: var(--success); border: 1px solid #a7e3b8; }

/* Detail */
.detail-layout { max-width: var(--container); margin: 16px auto; padding: 0 16px; display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
@media (max-width: 1000px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-gallery { background: #000; line-height: 0; }
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.detail-gallery .placeholder { color: #555; font-size: 80px; }
.detail-body { padding: 24px; }
.detail-title { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.detail-price { font-size: 28px; font-weight: 800; color: var(--primary); margin: 0 0 16px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.detail-meta .tag { background: var(--bg-soft); padding: 4px 10px; border-radius: 12px; font-weight: 500; }
.detail-attrs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.detail-attrs .attr { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.detail-attrs .attr-label { color: var(--text-secondary); font-weight: 500; }
.detail-attrs .attr-value { color: var(--text); font-weight: 600; }
.detail-description { font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.detail-sidebar .seller-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; }
.seller-card h3 { margin: 0 0 12px; font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.seller-card .seller-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.seller-card .seller-city { color: var(--text-secondary); font-size: 13px; margin-bottom: 0; }
.seller-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.seller-avatar-bubble { width: 48px; height: 48px; border-radius: 50%; background: var(--primary, #6366f1); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 700; overflow: hidden; flex-shrink: 0; border: 2px solid var(--border); }
.seller-avatar-bubble img { width: 100%; height: 100%; object-fit: cover; }
.badge-pro-inline { display: inline-flex; align-items: center; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; margin-left: 5px; vertical-align: middle; }
.btn-vendor-page { display: block; text-align: center; text-decoration: none; width: 100%; padding: 9px; border-radius: 9px; font-size: 13px; font-weight: 600; background: #f5f3ff; color: #4f46e5; border: 1.5px solid #c7d2fe; margin-bottom: 10px; transition: background .15s; }
.btn-vendor-page:hover { background: #ede9fe; }

/* Other pages */
.page-header { max-width: var(--container); margin: 24px auto 16px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; }
.page-header h1 { font-size: 24px; margin: 0; }
.empty-state { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; }
.conv-list { list-style: none; padding: 0; margin: 0; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.conv-list li { border-bottom: 1px solid var(--border); }
.conv-list li:last-child { border-bottom: 0; }
.conv-list a { display: block; padding: 14px 16px; color: inherit; }
.conv-list a:hover { background: var(--bg-soft); text-decoration: none; }
.conv-list .conv-title { font-weight: 600; margin-bottom: 3px; }
.conv-list .conv-last { font-size: 12.5px; color: var(--text-muted); }
.conv-list .badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-left: 8px; }
.chat-box { max-width: 800px; margin: 24px auto; padding: 0 16px; }
.chat-messages { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: 480px; overflow-y: auto; margin-bottom: 12px; }
.msg { margin-bottom: 12px; max-width: 75%; }
.msg.mine { margin-left: auto; }
.msg .bubble { padding: 8px 12px; border-radius: 14px; background: var(--bg-soft); font-size: 14px; }
.msg.mine .bubble { background: var(--primary); color: #fff; }
.msg .time { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding: 0 10px; }
.msg.mine .time { text-align: right; }
.chat-input { display: flex; gap: 8px; }
.chat-input textarea { flex: 1; resize: none; height: 50px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; }
.chat-input button { padding: 0 24px; background: var(--primary); color: #fff; border: 0; border-radius: var(--radius-sm); font-weight: 600; }

.static-page { max-width: 800px; margin: 32px auto; padding: 0 16px 60px; font-size: 15px; line-height: 1.7; }
.static-page h1 { font-size: 30px; margin: 0 0 8px; }
.static-page .lead { color: var(--text-secondary); font-size: 16px; margin-bottom: 24px; }
.static-page h2 { font-size: 20px; margin: 32px 0 12px; color: var(--primary); }
.static-page p { margin: 0 0 14px; color: var(--text); }
.static-page ul { padding-left: 22px; }
.static-page li { margin-bottom: 6px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.pagination button { border: 1px solid var(--border); background: var(--bg-elev); padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--text-muted); font-size: 14px; }
.loading::before { content: ''; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
