:root {
    --primary: #2563eb;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text-muted: #6b7280;
}
*{box-sizing:border-box;}
body{
    font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    max-width:1100px;
    margin:0 auto;
    padding:1.5rem;
    background:var(--bg);
    color:#111827;
}
h1,h2,h3,h4{margin:0 0 .5rem 0;}
.card{
    background:var(--card-bg);
    border-radius:12px;
    padding:1rem 1.25rem;
    margin-bottom:1rem;
    border:1px solid rgba(148,163,184,.35);
    box-shadow:0 10px 18px rgba(15,23,42,.08);
}
label{display:block;margin-bottom:.5rem;font-size:.9rem;font-weight:500;color:#374151;}
input,textarea,select,button{
    width:100%;
    padding:.45rem .6rem;
    margin-top:.2rem;
    margin-bottom:.7rem;
    border-radius:8px;
    border:1px solid var(--border);
    font:inherit;
    background:#f9fafb;
}
input:focus,textarea:focus,select:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 1px rgba(37,99,235,.15);
    background:#fff;
}
button{
    cursor:pointer;
    border:none;
    background:var(--primary);
    color:#fff;
    font-weight:600;
    box-shadow:0 10px 18px rgba(37,99,235,.35);
}
button.small{width:auto;font-size:.8rem;padding:.25rem .55rem;box-shadow:none;}
button.secondary{background:#4b5563;box-shadow:none;}
button.ghost{background:#e5e7eb;color:#111827;box-shadow:none;}
button[disabled]{opacity:.6;cursor:not-allowed;box-shadow:none;}
nav.main-menu{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem;width: 100%}
nav.main-menu button{
    background:#e5e7eb;color:#111827;border-radius:999px;border:1px solid transparent;
}
nav.main-menu button.active{
    background:#1d4ed8;color:#eff6ff;box-shadow:0 8px 14px rgba(37,99,235,.35);
}
.lang-switcher{display:block;align-items:center;gap:.4rem;font-size:.85rem;text-align: right;}
.lang-switcher select{width:auto;}
.lang-switcher span{min-width: 200px;}
.small-label{
    font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);margin-bottom:.25rem;
}
.header-row{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap;}
.badge{
    display:inline-flex;align-items:center;padding:.1rem .5rem;border-radius:999px;font-size:.75rem;background:#e5e7eb;margin-left:.25rem;
}
.badge.accepted{background:#dcfce7;color:#166534;}
.badge.pending{background:#fef3c7;color:#92400e;}
.badge.blocked{background:#fee2e2;color:#b91c1c;}
.view{display:none;}
.view.active{display:block;}
.search-layout{display:grid;grid-template-columns:minmax(0,1.4fr)minmax(0,1.1fr);gap:1rem;}
.ad-details-two{display:grid;grid-template-columns:minmax(0,1.4fr)minmax(0,1.1fr);gap:.75rem;}
.ads-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:.75rem;}
.ad-thumb{
    background:#f9fafb;border-radius:12px;padding:.4rem .5rem;border:1px solid rgba(209,213,219,.9);
    display:flex;flex-direction:column;cursor:pointer;transition:.12s;
}
.ad-thumb:hover{transform:translateY(-2px);box-shadow:0 10px 16px rgba(15,23,42,.18);border-color:#93c5fd;background:#eff6ff;}
.ad-thumb img{width:100%;height:110px;object-fit:cover;border-radius:9px;margin-bottom:.3rem;background:#e5e7eb;}
.ad-thumb-title{font-size:.9rem;font-weight:600;margin-bottom:.1rem;}
.ad-thumb-price{font-size:.9rem;font-weight:700;color:#166534;}
.ad-thumb-meta{font-size:.7rem;color:var(--text-muted);margin-top:.1rem;}
.ad-details{border-radius:12px;border:1px solid var(--border);padding:.7rem .8rem;background:#f9fafb;}
.ad-details img{max-width:100%;border-radius:10px;margin-top:.4rem;}
.ad-meta{font-size:.8rem;color:var(--text-muted);margin-top:.3rem;}
.seller-card{border-radius:10px;border:1px solid var(--border);background:#fff;padding:.6rem .7rem;font-size:.85rem;}
.tagline-list span{display:inline-flex;align-items:center;background:#eef2ff;color:#3730a3;border-radius:999px;padding:.1rem .45rem;margin:0 .25rem .25rem 0;font-size:.75rem;}
.ad-tags span{display:inline-flex;align-items:center;background:#e0f2fe;border-radius:999px;padding:.1rem .45rem;margin:0 .25rem .25rem 0;font-size:.75rem;}
.ads-filters{display:flex;gap:.5rem;margin-bottom:.75rem;flex-wrap:wrap;}
.ads-filters select,.ads-filters input{min-width:160px;flex:1 1 160px;}
.two-col-inline{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.5rem 1rem;}
.myads-list{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem;}
.myads-item{border-radius:10px;border:1px solid var(--border);padding:.5rem .75rem;background:#f9fafb;display:flex;gap:.75rem;font-size:.85rem;}
.myads-thumb{width:80px;height:60px;border-radius:8px;object-fit:cover;background:#e5e7eb;}
.myads-title{font-weight:600;}
.status-pill{display:inline-flex;align-items:center;font-size:.7rem;border-radius:999px;padding:.1rem .45rem;margin-left:.25rem;background:#e5e7eb;}
.status-pill.pending{background:#fef3c7;color:#92400e;}
.status-pill.accepted{background:#dcfce7;color:#166534;}
.status-pill.rejected{background:#fee2e2;color:#b91c1c;}
.pagination{display:flex;gap:.5rem;align-items:center;margin:.7rem 0;flex-wrap:wrap;}
.pagination .page-label{font-size:.9rem;color:#374151;padding:.25rem .5rem;background:#e5e7eb;border-radius:8px;}
.messages-layout{display:grid;grid-template-columns:minmax(0,.9fr)minmax(0,1.6fr);gap:1rem;}
.conv-list{border:1px solid var(--border);background:#f9fafb;border-radius:10px;padding:.5rem;max-height:520px;overflow:auto;}
.conv-item{padding:.5rem .6rem;border-radius:8px;cursor:pointer;border:1px solid transparent;margin-bottom:.35rem;background:#fff;}
.conv-item.active{border-color:#93c5fd;background:#eff6ff;}
.conv-title{font-weight:600;font-size:.9rem;margin-bottom:.1rem;}
.conv-snippet{font-size:.8rem;color:var(--text-muted);}
.chat-box{border:1px solid var(--border);background:#fff;border-radius:10px;padding:.5rem .6rem;display:flex;flex-direction:column;min-height:420px;max-height:520px;}
.chat-messages{flex:1;overflow:auto;padding:.25rem .25rem .5rem;}
.msg-row{display:flex;margin:.25rem 0;}
.msg-row.me{justify-content:flex-end;}
.msg-bubble{max-width:78%;padding:.4rem .55rem;border-radius:10px;font-size:.85rem;background:#f3f4f6;}
.msg-row.me .msg-bubble{background:#dbeafe;}
.msg-meta{font-size:.7rem;color:var(--text-muted);margin-top:.1rem;}
.chat-input{display:flex;gap:.5rem;margin-top:.35rem;}
.chat-input input{margin-bottom:0;}
@media(max-width:900px){
    body{padding:1rem;}
    .search-layout,.ad-details-two,.messages-layout{grid-template-columns:1fr;}
}



#message-center {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, 92vw);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.msg {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 10px;

    padding: 12px 12px 12px 14px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    border-left: 4px solid transparent;

    animation: msg-in 160ms ease-out;
}

.msg__text {
    line-height: 1.35;
    font-size: 14px;
    word-break: break-word;
}

.msg__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    opacity: 0.8;
}
.msg__close:hover { opacity: 1; }

.msg--info    { border-left-color: #4ea1ff; }
.msg--success { border-left-color: #38d996; }
.msg--warn    { border-left-color: #ffb020; }
.msg--error   { border-left-color: #ff5c5c; }

.msg--light {
    background: #fff;
    color: #111;
    border: 1px solid #e8e8e8;
}

@keyframes msg-in {
    from { transform: translateY(-6px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}