:root{
  --purple: #5b2b82;
  --green: #6aa84f;
  --bg:#f6f6f8;
  --card:#ffffff;
  --text:#15151a;
  --muted:#6b6b76;
  --border:#e7e7ee;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);}
a{color:inherit}

.header{
  background:linear-gradient(90deg,var(--purple),#2c2140);
  color:#fff;
  padding:18px;
  border-bottom:4px solid var(--green);
}
.header-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;}
.brand{display:flex;align-items:center;gap:12px}
.brand img{width:44px;height:44px;border-radius:10px;background:#fff;padding:6px;object-fit:contain}
.brand h1{font-size:18px;margin:0;line-height:1.2}
.brand p{margin:2px 0 0;font-size:12px;opacity:.9}

.container{max-width:1200px;margin:18px auto;padding:0 18px 40px}

.toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.search{flex:1;min-width:260px;display:flex;gap:10px;align-items:center}
.search input{
  width:100%;
  max-width:520px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
}

.btn{
  appearance:none;border:0;padding:10px 12px;border-radius:10px;cursor:pointer;
  font-weight:700;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.btn-green{background:var(--green);color:#fff}
.btn-purple{background:var(--purple);color:#fff}
.btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text);background:#fff}
.btn:hover{filter:brightness(0.98)}

.notice{background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:14px}
.small{font-size:12px;color:var(--muted)}
.kpi{font-size:13px;color:var(--muted)}
.footer{margin-top:18px;font-size:12px;color:var(--muted)}
code{background:#f1f1f6;padding:2px 6px;border-radius:6px}

/* ===== Tags ===== */
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.tag{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #c7d7e6;
  background:#ffffff;
  color:#0f2440;
}

/* Toggle style */
.tag-toggle{cursor:pointer}
.tag-toggle.selected{
  background:var(--green);
  border-color:var(--green);
  color:#fff;
}
.tag-static{cursor:default;user-select:none}

/* ===== Filter dropdown ===== */
.filters{ position:relative; display:inline-block; margin-bottom:14px; }
.filter-panel{
  position:absolute;
  top:52px;
  left:0;
  z-index:50;
  width:min(920px, calc(100vw - 36px));
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,0.12);
}
.filter-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.filter-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* neat multi-column tags inside popup */
.tag-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
  gap:10px;
}

/* selected count pill on Filters button */
.pill{
  margin-left:8px;
  background:var(--green);
  color:#fff;
  border-radius:999px;
  padding:2px 8px;
  font-size:12px;
  font-weight:900;
  display:inline-flex;
}

/* ===== Card (image full tile) ===== */
.card{
  position:relative;
  width:280px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 1px 0 rgba(0,0,0,0.03);
  display:flex;
  flex-direction:column;
  transition:box-shadow .12s ease-in-out;
}
.card:hover{box-shadow:0 10px 24px rgba(0,0,0,0.14)}

.img{
  position:absolute;
  inset:0;
  z-index:0;
  background:#f0f0f6;
}
.img img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:top center;
  display:block;
}

/* title text only */
.card-title-overlay{
  position:absolute;
  top:10px;
  left:10px;
  z-index:2;
  display:inline-block;
  max-width:calc(100% - 20px);
  background:rgba(255,255,255,0.95);
  padding:6px 10px;
  border-radius:8px;
  font-size:15px;
  font-weight:900;
  color:#0f2440;
  box-shadow:0 2px 6px rgba(0,0,0,0.15);
}

.body{
  position:relative;
  z-index:2;
  padding:160px 12px 14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
p{margin:0;color:var(--muted);font-size:13px;line-height:1.35;min-height:34px}
.actions{margin-top:auto;display:flex;gap:10px;flex-wrap:wrap}

/* ===== Carousel ===== */
.carousel-wrap{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
}

.carousel{
  flex:1;
  display:flex;
  gap:14px;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  padding:8px 6px;
  border-radius:14px;
  scroll-snap-type:x mandatory;
}
.carousel .card{flex:0 0 auto;scroll-snap-align:start;}

.carousel::-webkit-scrollbar{height:10px}
.carousel::-webkit-scrollbar-track{background:transparent}
.carousel::-webkit-scrollbar-thumb{background:#d6d6e3;border-radius:999px}
.carousel:focus{outline:2px solid rgba(91,43,130,0.25);outline-offset:4px}

.carousel-btn{
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-size:24px;
  line-height:1;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
}
.carousel-btn:hover{filter:brightness(0.98)}
.carousel-btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}

/* mobile: overlay arrows */
@media (max-width:720px){
  .carousel-wrap{gap:0}
  .carousel-btn{
    position:absolute;
    z-index:5;
    top:50%;
    transform:translateY(-50%);
  }
  .carousel-btn.left{left:-6px}
  .carousel-btn.right{right:-6px}
  .carousel{padding:8px 46px}
}