:root{
    --brand:#ef233c;
    --brand-dark:#c1121f;
    --ink:#0f172a;
    --muted:#64748b;
}
*{box-sizing:border-box}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
a{text-decoration:none}
.brand-mark{display:flex;align-items:center;gap:.55rem;color:var(--ink);font-size:1.25rem}
.brand-mark strong{color:var(--brand)}
.brand-icon{
    width:42px;height:42px;border-radius:14px;display:grid;place-items:center;
    color:white;background:linear-gradient(135deg,var(--brand),#ff6b6b);
    box-shadow:0 8px 24px rgba(239,35,60,.25)
}
.post-ad-btn{background:var(--brand);border-color:var(--brand)}
.hero{
    background:
        radial-gradient(circle at 15% 20%, rgba(239,35,60,.30), transparent 33%),
        radial-gradient(circle at 90% 10%, rgba(37,99,235,.24), transparent 30%),
        linear-gradient(135deg,#020617,#111827 55%,#1e293b);
    color:white;border-radius:0 0 32px 32px;
}
.hero-search{background:white;border-radius:18px;padding:12px;box-shadow:0 20px 45px rgba(0,0,0,.18)}
.category-card{
    background:#fff;border:1px solid #e2e8f0;border-radius:20px;padding:20px;
    transition:.25s ease;height:100%;
}
.category-card:hover{transform:translateY(-5px);box-shadow:0 18px 35px rgba(15,23,42,.09);border-color:#cbd5e1}
.category-icon{
    width:54px;height:54px;border-radius:16px;background:#f1f5f9;
    display:grid;place-items:center;font-size:1.3rem;margin-bottom:14px
}
.ad-card{background:#fff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;transition:.25s}
.ad-card:hover{transform:translateY(-4px);box-shadow:0 14px 30px rgba(15,23,42,.08)}
.ad-card img{width:100%;height:200px;object-fit:cover}
.badge-featured{background:#f59e0b;color:#111827}
.price{font-weight:800;color:var(--brand);font-size:1.25rem}
.site-footer{background:#020617;color:white}
.site-footer a{display:block;color:#94a3b8;margin:.4rem 0}
.site-footer a:hover{color:white}
.panel{background:white;border:1px solid #e2e8f0;border-radius:22px;padding:24px}
.stat-card{background:white;border:1px solid #e2e8f0;border-radius:20px;padding:20px}
.form-control,.form-select{min-height:46px;border-radius:12px}
.btn{border-radius:12px}
.sidebar-link{display:flex;gap:.7rem;align-items:center;padding:.85rem 1rem;border-radius:12px;color:#334155}
.sidebar-link:hover,.sidebar-link.active{background:#0f172a;color:white}
@media(max-width:768px){.hero{border-radius:0 0 22px 22px}.ad-card img{height:170px}}


/* Mobile-first posting experience */
.mobile-bottom-nav{display:none}
.plan-card{
  border:2px solid #e2e8f0;border-radius:18px;padding:16px;background:#fff;
  cursor:pointer;transition:.2s ease;height:100%;
}
.plan-card:hover{border-color:#94a3b8;transform:translateY(-2px)}
.plan-radio:checked + .plan-card{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(239,35,60,.08);
  background:#fff7f8;
}
.payment-slip-box{
  border:2px dashed #cbd5e1;border-radius:18px;padding:20px;text-align:center;background:#f8fafc
}
.payment-slip-box input{max-width:100%}
@media(max-width:768px){
  body{padding-bottom:72px}
  header .container{padding-left:12px;padding-right:12px}
  .brand-mark{font-size:1rem}
  .brand-icon{width:38px;height:38px;border-radius:12px}
  header nav .btn{padding:.55rem .75rem;font-size:.88rem}
  .post-ad-btn{display:none}
  .hero{padding-top:1rem!important}
  .hero h1{font-size:2rem!important;line-height:1.1}
  .hero .lead{font-size:1rem}
  .hero-search{padding:10px;border-radius:15px}
  .panel{padding:18px;border-radius:18px}
  .category-card{padding:16px;border-radius:16px}
  .category-icon{width:48px;height:48px}
  .mobile-bottom-nav{
    display:grid;grid-template-columns:repeat(4,1fr);position:fixed;z-index:1000;
    left:0;right:0;bottom:0;background:#fff;border-top:1px solid #e2e8f0;
    box-shadow:0 -8px 28px rgba(15,23,42,.08)
  }
  .mobile-bottom-nav a{
    color:#475569;text-align:center;padding:10px 4px;font-size:.72rem
  }
  .mobile-bottom-nav i{display:block;font-size:1.1rem;margin-bottom:3px}
  .mobile-bottom-nav .post-mobile{color:var(--brand);font-weight:700}
}

.category-sidebar{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:18px}
.category-sidebar a{display:flex;align-items:center;gap:10px;padding:8px 4px;color:#334155;font-size:.92rem}
.category-sidebar a:hover{color:var(--brand);transform:translateX(2px)}
.category-sidebar a i{width:20px;text-align:center;color:var(--brand)}
@media(max-width:991px){.category-sidebar{display:none}}

.ad-list-row{background:#fff;border:1px solid #e2e8f0;border-radius:16px;overflow:hidden;transition:.2s}
.ad-list-row:hover{box-shadow:0 12px 28px rgba(15,23,42,.08);transform:translateY(-2px)}
.ad-list-row .thumb{width:180px;height:130px;object-fit:cover}
.super-badge{background:#facc15;color:#111827;font-size:.68rem;font-weight:800;padding:4px 7px;border-radius:5px}
.cash-badge{background:#16a34a;color:white;font-size:.68rem;font-weight:700;padding:4px 7px;border-radius:5px}
.metric{font-size:.75rem;color:#2563eb}
.city-card{background:white;border:1px solid #e2e8f0;border-radius:16px;padding:16px;transition:.2s}
.city-card:hover{border-color:#cbd5e1;box-shadow:0 10px 24px rgba(15,23,42,.06)}
.filters-panel{background:white;border:1px solid #e2e8f0;border-radius:18px;padding:18px}
.section-title{font-weight:800}
@media(max-width:768px){
  .ad-list-row{display:flex!important}
  .ad-list-row .thumb{width:120px;height:115px;flex:0 0 120px}
  .ad-list-row .ad-body{padding:10px!important}
  .ad-list-row h5{font-size:.95rem;margin-bottom:4px}
  .ad-list-row .desc{font-size:.78rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .metric{font-size:.68rem}
  .hide-mobile{display:none!important}
}

/* ===== DealGo.lk Compact Classified Theme ===== */
:root{
  --dg-red:#ef233c;
  --dg-red-dark:#c1121f;
  --dg-blue:#1d4ed8;
  --dg-ink:#0f172a;
  --dg-soft:#f8fafc;
  --dg-border:#d8dee8;
  --dg-yellow:#facc15;
  --dg-green:#16a34a;
}
body.compact-market{
  background:#fff;
  font-size:14px;
}
.dg-topbar{
  background:linear-gradient(90deg,var(--dg-red),#8b3fa7 50%,var(--dg-blue));
  color:white;
  min-height:50px;
}
.dg-shell{
  max-width:1120px;
  margin:0 auto;
}
.dg-logo{
  display:flex;align-items:center;gap:8px;color:white;font-weight:800;
}
.dg-logo-box{
  width:34px;height:34px;background:white;color:var(--dg-red);
  border-radius:7px;display:grid;place-items:center;
  box-shadow:0 3px 10px rgba(0,0,0,.15)
}
.dg-top-actions .btn{
  padding:.35rem .6rem;border-radius:5px;font-size:.73rem;font-weight:700
}
.dg-layout{
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:16px;
  max-width:1120px;
  margin:10px auto 0;
  padding:0 10px 40px;
}
.dg-side-box{
  border:1px solid var(--dg-border);
  border-radius:6px;
  background:#fff;
  padding:12px;
  margin-bottom:12px;
}
.dg-side-box h5{
  font-size:16px;font-weight:800;margin:0 0 10px;
  padding-bottom:7px;border-bottom:3px solid var(--dg-red);display:inline-block
}
.dg-side-actions{
  display:grid;gap:7px;
}
.dg-side-actions a{
  display:block;text-align:center;padding:7px 8px;border-radius:4px;
  font-size:.76rem;font-weight:800;color:#fff
}
.dg-side-actions .agent{background:#df2776}
.dg-side-actions .premium{background:#f4c400;color:#111}
.dg-side-actions .fake{background:#111827}
.dg-side-actions .saved{background:#b91c1c}
.dg-side-actions .blog{background:#0891b2}
.dg-side-actions .login{background:#0f172a}
.dg-list-link{
  display:flex;align-items:center;gap:8px;
  color:#273449;padding:5px 0;font-size:.8rem;
}
.dg-list-link i{color:var(--dg-red);width:15px;text-align:center}
.dg-list-link:hover{color:var(--dg-red)}
.dg-feed-tools{
  display:flex;justify-content:center;gap:6px;flex-wrap:wrap;
  margin:0 0 10px;
}
.dg-feed-tools .btn{
  border-radius:5px;padding:.35rem .65rem;font-size:.72rem;font-weight:800
}
.dg-feed-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:10px;
}
.dg-ad{
  border:1.5px solid #f0b90b;
  border-radius:6px;background:#fff;overflow:hidden;
  display:grid;grid-template-columns:122px minmax(0,1fr);
  min-height:112px;position:relative;
}
.dg-ad.featured{border-color:#f0b90b}
.dg-ad-image{
  width:122px;height:112px;object-fit:cover;border-right:1px solid #e5e7eb
}
.dg-ad-body{
  padding:9px 10px 7px;min-width:0;position:relative;
}
.dg-ad-title{
  font-size:.82rem;font-weight:800;color:#374151;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  padding-right:38px;margin-bottom:4px
}
.dg-ad-desc{
  font-size:.75rem;line-height:1.35;color:#6b7280;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
  min-height:32px
}
.dg-ad-meta{
  display:flex;align-items:center;gap:16px;flex-wrap:wrap;
  margin-top:6px;font-size:.67rem;color:#2563eb;
}
.dg-ad-time{
  margin-left:auto;color:#6b7280
}
.dg-badge{
  position:absolute;right:4px;top:-1px;
  background:var(--dg-yellow);color:#111;
  border-radius:0 0 4px 4px;padding:2px 6px;font-size:.58rem;font-weight:800
}
.dg-cash{
  position:absolute;left:126px;top:2px;
  background:var(--dg-green);color:#fff;padding:2px 5px;border-radius:3px;
  font-size:.56rem;font-weight:800;z-index:2
}
.dg-premium{
  position:absolute;right:42px;top:-1px;
  background:#22c55e;color:white;padding:2px 5px;border-radius:0 0 4px 4px;
  font-size:.55rem;font-weight:800
}
.dg-wide-ad{
  grid-column:1/-1;
  display:grid;grid-template-columns:130px minmax(0,1fr);
  min-height:96px
}
.dg-wide-ad .dg-ad-image{width:130px;height:96px}
.dg-wide-ad .dg-ad-desc{-webkit-line-clamp:2}
.dg-main-head{
  display:flex;justify-content:space-between;align-items:center;margin-bottom:8px
}
.dg-main-head h1{font-size:1rem;font-weight:800;margin:0}
.dg-main-head small{font-size:.7rem;color:#64748b}
.dg-mobile-cat-strip{display:none}
.dg-post-fab{display:none}

@media(max-width:991px){
  .dg-layout{grid-template-columns:190px minmax(0,1fr);max-width:920px}
  .dg-ad{grid-template-columns:104px minmax(0,1fr)}
  .dg-ad-image{width:104px;height:108px}
  .dg-cash{left:108px}
}
@media(max-width:768px){
  body.compact-market{font-size:13px;padding-bottom:66px}
  .dg-topbar{min-height:48px}
  .dg-shell{padding:0 10px}
  .dg-top-actions .hide-sm{display:none}
  .dg-layout{display:block;margin-top:8px;padding:0 8px 20px}
  .dg-sidebar{display:none}
  .dg-mobile-cat-strip{
    display:flex;gap:7px;overflow-x:auto;padding:3px 0 9px;
    scrollbar-width:none
  }
  .dg-mobile-cat-strip::-webkit-scrollbar{display:none}
  .dg-mobile-cat-strip a{
    white-space:nowrap;border:1px solid #e2e8f0;border-radius:999px;
    padding:7px 10px;color:#334155;background:#fff;font-size:.72rem
  }
  .dg-feed-tools{justify-content:flex-start;overflow-x:auto;flex-wrap:nowrap}
  .dg-feed-tools .btn{white-space:nowrap}
  .dg-feed-grid{grid-template-columns:1fr;gap:8px}
  .dg-wide-ad{grid-column:auto}
  .dg-ad,.dg-wide-ad{
    grid-template-columns:112px minmax(0,1fr);min-height:108px
  }
  .dg-ad-image,.dg-wide-ad .dg-ad-image{width:112px;height:108px}
  .dg-cash{left:116px}
  .dg-ad-body{padding:8px 8px 6px}
  .dg-ad-title{font-size:.8rem}
  .dg-ad-desc{font-size:.72rem}
  .dg-ad-meta{gap:10px}
  .dg-post-fab{
    display:flex;position:fixed;right:14px;bottom:78px;z-index:1000;
    width:52px;height:52px;border-radius:50%;background:var(--dg-red);
    color:white;align-items:center;justify-content:center;
    box-shadow:0 10px 25px rgba(239,35,60,.35);font-size:1.2rem
  }
}

/* ===== Compact feed alignment/overlap fixes ===== */
.dg-layout{grid-template-columns:250px minmax(0,1fr);max-width:1500px;gap:20px}
.dg-main{min-width:0}
.dg-feed-grid{align-items:stretch;grid-auto-flow:row}
.dg-ad{
  grid-template-columns:155px minmax(0,1fr);
  min-height:142px;
  overflow:hidden;
}
.dg-ad-image{width:155px;height:142px;display:block}
.dg-ad-body{
  padding:16px 14px 10px;
  min-width:0;
  overflow:hidden;
}
.dg-ad-title{
  padding-right:64px;
  line-height:1.3;
  min-height:20px;
  margin:0 0 6px;
}
.dg-ad-desc{min-height:38px}
.dg-ad-meta{margin-top:10px}
.dg-badge{
  top:0;right:5px;z-index:8;
  max-width:62px;white-space:nowrap;
}
.dg-cash{
  left:160px;top:4px;z-index:7;
  max-width:150px;white-space:nowrap;
}
.dg-premium{
  top:0;right:67px;z-index:8;
  white-space:nowrap;
}
.dg-wide-ad{
  grid-template-columns:155px minmax(0,1fr);
  min-height:122px;
}
.dg-wide-ad .dg-ad-image{width:155px;height:122px}
.dg-wide-ad .dg-ad-body{padding-top:18px}
.dg-wide-ad .dg-cash{left:160px}
.dg-main-head{min-height:30px}
.dg-main-head h1{font-size:1.15rem}
.dg-side-box{padding:15px}
.dg-list-link{font-size:.88rem;padding:7px 0}

@media(max-width:1199px){
  .dg-layout{grid-template-columns:220px minmax(0,1fr);max-width:1120px}
  .dg-ad{grid-template-columns:125px minmax(0,1fr);min-height:125px}
  .dg-ad-image{width:125px;height:125px}
  .dg-cash{left:130px}
  .dg-wide-ad{grid-template-columns:130px minmax(0,1fr)}
  .dg-wide-ad .dg-ad-image{width:130px;height:115px}
  .dg-wide-ad .dg-cash{left:135px}
}
@media(max-width:768px){
  .dg-layout{display:block}
  .dg-feed-grid{grid-template-columns:1fr}
  .dg-ad,.dg-wide-ad{
    grid-template-columns:112px minmax(0,1fr);
    min-height:112px;
  }
  .dg-ad-image,.dg-wide-ad .dg-ad-image{width:112px;height:112px}
  .dg-cash,.dg-wide-ad .dg-cash{left:116px;top:3px;max-width:125px}
  .dg-premium{right:60px}
  .dg-ad-body{padding:20px 8px 7px}
  .dg-ad-title{padding-right:55px}
}

/* DealGo Admin <-> Client chat */
.dg-chat-widget{position:fixed;right:18px;bottom:20px;z-index:1600}
.dg-chat-toggle{
  width:58px;height:58px;border:0;border-radius:50%;
  background:linear-gradient(135deg,var(--brand,#ef233c),#991b1b);
  color:#fff;font-size:1.25rem;
  box-shadow:0 12px 30px rgba(239,35,60,.35);
  position:relative;
}
.dg-chat-unread{
  position:absolute;right:-2px;top:-4px;background:#111827;color:#fff;
  min-width:20px;height:20px;border-radius:20px;font-size:.67rem;
  display:grid;place-items:center;padding:0 5px;border:2px solid #fff
}
.dg-chat-panel{
  position:absolute;right:0;bottom:70px;width:360px;height:500px;
  background:#fff;border:1px solid #e2e8f0;border-radius:18px;
  box-shadow:0 24px 60px rgba(15,23,42,.2);overflow:hidden;
  display:flex;flex-direction:column
}
.dg-chat-head{
  background:#0f172a;color:#fff;padding:14px 16px;
  display:flex;align-items:center;justify-content:space-between
}
.dg-chat-head small{display:block;color:#94a3b8;font-size:.72rem}
.dg-chat-head button{border:0;background:transparent;color:#fff;font-size:1rem}
.dg-chat-messages{
  flex:1;overflow-y:auto;padding:14px;background:#f8fafc
}
.dg-chat-msg{max-width:82%;margin-bottom:9px}
.dg-chat-msg>div{padding:9px 11px;border-radius:12px;white-space:pre-wrap;word-break:break-word}
.dg-chat-msg small{display:block;margin-top:2px;color:#94a3b8;font-size:.62rem}
.dg-chat-msg.mine{margin-left:auto;text-align:right}
.dg-chat-msg.mine>div{background:#ef233c;color:white;border-bottom-right-radius:4px}
.dg-chat-msg.theirs{margin-right:auto}
.dg-chat-msg.theirs>div{background:#fff;border:1px solid #e2e8f0;color:#1e293b;border-bottom-left-radius:4px}
.dg-chat-form{display:flex;gap:7px;padding:10px;border-top:1px solid #e2e8f0;background:#fff}
.dg-chat-form .form-control{min-height:42px}
@media(max-width:768px){
  .dg-chat-widget{right:12px;bottom:82px}
  .dg-chat-toggle{width:52px;height:52px}
  .dg-chat-panel{
    position:fixed;left:8px;right:8px;bottom:72px;width:auto;height:min(70vh,560px)
  }
}
