:root{
  --bg:#f7f8fc;
  --panel:#ffffff;
  --card:#ffffff;
  --stroke:rgba(15,18,32,.10);
  --ink:#0f1220;
  --muted:rgba(15,18,32,.62);
  --soft:rgba(15,18,32,.06);
  --soft2:rgba(15,18,32,.04);

  --accent:#16c79a;
  --accent2:#4f7cff;

  --warn:#ffb020;
  --good:#18b26b;
  --bad:#e5484d;

  --shadow: 0 18px 50px rgba(10,12,18,.10);
  --r16:16px;
  --r22:22px;
  --r28:28px;
  --max:1100px;
}

*{box-sizing:border-box}
html,body{height:100%}

/* FIX: stop any horizontal overflow */
html, body{
  overflow-x:hidden;
  width:100%;
  max-width:100%;
}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(79,124,255,.14), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(22,199,154,.12), transparent 60%),
    var(--bg);
  color:var(--ink);
}

img, svg, video, canvas{
  max-width:100%;
  height:auto;
}

a{color:inherit; text-decoration:none}
button{font-family:inherit}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; justify-content:space-between; gap:12px;
  padding:14px 14px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--stroke);
  width:100%;
  max-width:100%;
}

.brand{display:flex; align-items:center; gap:12px; min-width:0}
.brandMark{
  width:38px; height:38px; border-radius:14px;
  background:
    radial-gradient(18px 18px at 30% 30%, rgba(255,255,255,.85), transparent 60%),
    linear-gradient(135deg, rgba(22,199,154,.95), rgba(79,124,255,.95));
  box-shadow: 0 14px 35px rgba(0,0,0,.10);
  flex:0 0 auto;
}
.brandText{min-width:0}
.brandName{
  font-weight:900;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 100%;
}
.brandTag{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 100%;
}

.topActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  max-width: 52%;
}
.pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  color:var(--ink);
  font-weight:800;
  font-size:13px;
  cursor:pointer;
}
.pill:hover{background: rgba(15,18,32,.03)}
.pillGhost{background: transparent}

.backLink{
  display:inline-flex; align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  font-weight:900;
}

.hero{padding:18px 14px 8px; width:100%; max-width:100%}
.heroInner{
  max-width:var(--max);
  margin:0 auto;
  display:grid;
  gap:14px;
  width:100%;
  max-width:100%;
}
.heroCopy{
  background: rgba(255,255,255,.92);
  border:1px solid var(--stroke);
  border-radius: var(--r28);
  box-shadow: var(--shadow);
  padding:18px;
  max-width:100%;
}
.heroCopy h1{
  margin:0 0 6px;
  font-size:34px;
  letter-spacing:-.8px;
}
.heroCopy p{margin:0 0 14px; color:var(--muted); line-height:1.35}

.heroSearch{display:grid; gap:10px}
.heroRow{display:grid; grid-template-columns:1fr 1fr; gap:10px}

.field{display:grid; gap:6px; min-width:0}
.fieldLabel{font-size:12px; color:var(--muted); font-weight:800}

input, select, textarea{
  width:100%;
  max-width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.03);
  color:var(--ink);
  outline:none;
}

textarea{resize:vertical}

input:focus, select:focus, textarea:focus{
  border-color: rgba(22,199,154,.55);
  box-shadow: 0 0 0 4px rgba(22,199,154,.10);
}

.heroButtons{display:flex; gap:10px; flex-wrap:wrap; margin-top:4px}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.95);
  font-weight:900;
  cursor:pointer;
  max-width:100%;
}
.btn:hover{background: rgba(15,18,32,.03)}
.btnPrimary{
  border-color: rgba(22,199,154,.45);
  background: linear-gradient(135deg, rgba(22,199,154,.18), rgba(79,124,255,.10));
}
.btnSoft{
  background: rgba(255,255,255,.92);
}

.hint{font-size:12px; color:var(--muted)}
.linkBtn{
  border:0; background:transparent; color:var(--accent2);
  font-weight:900; cursor:pointer; padding:0 2px;
}

.heroCard{
  background: rgba(255,255,255,.92);
  border:1px solid var(--stroke);
  border-radius: var(--r28);
  box-shadow: var(--shadow);
  padding:16px;
  max-width:100%;
}
.heroCardTop{display:flex; gap:10px; align-items:center}
.pulseDot{
  width:14px; height:14px; border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(22,199,154,.35);
  animation: pulse 1.8s infinite;
}
@keyframes pulse{
  0%{box-shadow: 0 0 0 0 rgba(22,199,154,.35)}
  70%{box-shadow: 0 0 0 14px rgba(22,199,154,0)}
  100%{box-shadow: 0 0 0 0 rgba(22,199,154,0)}
}
.miniTitle{font-weight:1000}
.miniText{font-size:12px; color:var(--muted)}

.statGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.stat{
  padding:12px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
}
.statNum{font-size:20px; font-weight:1000}
.statLabel{font-size:12px; color:var(--muted); margin-top:2px}

.divider{height:1px; background:var(--stroke); margin:14px 0}

.categoryChips{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
  font-weight:900;
  font-size:13px;
}
.chip:hover{background: rgba(15,18,32,.04)}
.chip .sub{display:inline-block; margin-left:6px; opacity:.7; font-weight:800}

.panel{
  max-width:var(--max);
  margin:0 auto;
  padding:12px 14px 100px;
  width:100%;
  max-width:100%;
}
.panelHead{
  display:flex; justify-content:space-between; align-items:flex-end; gap:10px;
  margin:10px 0 10px;
}
.panelHead h2{margin:0; font-size:18px}
.panelTools{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  min-width:0;
}

.toggle{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  font-weight:900;
  font-size:13px;
  cursor:pointer;
}
.toggle input{width:auto}

.resultsMeta{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  margin-bottom:10px;
  flex-wrap:wrap;
}
.sortRow{display:flex; gap:8px; align-items:center; min-width:0}
.muted{color:var(--muted)}

.cards{
  display:grid;
  gap:12px;
  width:100%;
  max-width:100%;
}

/* IMPORTANT: prevent cards from overflowing screen */
.card{
  border-radius: var(--r22);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  padding:14px;
  width:100%;
  max-width:100%;
  overflow:hidden; /* key fix */
}

.cardTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}

.cardLeft{
  display:flex;
  gap:12px;
  align-items:center;
  min-width:0;
  flex:1 1 auto;
}

.minw0{min-width:0}

.avatar{
  width:44px; height:44px; border-radius:16px;
  background: linear-gradient(135deg, rgba(79,124,255,.85), rgba(22,199,154,.70));
  border:1px solid rgba(15,18,32,.10);
  flex:0 0 auto;
}

.cardName{
  font-weight:1000;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

.cardMeta{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

.badge{
  display:inline-flex; align-items:center; justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.03);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

.badgeGood{border-color: rgba(24,178,107,.25); background: rgba(24,178,107,.10); color:#0b4b2d}
.badgeWarn{border-color: rgba(255,176,32,.25); background: rgba(255,176,32,.12); color:#6a3d00}
.badgeSoft{background: rgba(15,18,32,.02)}

.rowWrap{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  min-width:0;
}

.cardBody{
  margin-top:10px;
  display:grid;
  gap:10px;
  min-width:0;
}

/* IMPORTANT: tag chips MUST wrap and stay inside card */
.tags{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  min-width:0;
  max-width:100%;
}

.tag{
  padding:8px 10px;
  border-radius:999px;
  background: rgba(15,18,32,.02);
  border:1px solid var(--stroke);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
  max-width:100%;
}

.cardActions{
  display:grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap:10px;
  width:100%;
  max-width:100%;
}

.iconBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  font-weight:1000;
  width:100%;
  max-width:100%;
}

.iconBtn:hover{background: rgba(15,18,32,.03)}
.icon{opacity:.9}

.stickyBar{
  position:fixed;
  left:10px;
  right:10px;
  bottom:10px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr 1.1fr;
  gap:10px;
  padding:10px;
  border-radius: 22px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(10,12,18,.10);
  z-index:60;
  max-width: calc(100% - 20px);
}

.stickyBtn{
  padding:12px 10px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
  display:flex; align-items:center; justify-content:center; gap:8px;
  font-weight:1000;
  text-align:center;
  max-width:100%;
}

.stickyBtn:hover{background: rgba(15,18,32,.04)}
.stickyPrimary{
  border-color: rgba(22,199,154,.35);
  background: linear-gradient(135deg, rgba(22,199,154,.16), rgba(79,124,255,.10));
}
.stickyIcon{filter: saturate(1.1);}

.footer{
  max-width:var(--max);
  margin:0 auto;
  padding:22px 14px 100px;
  opacity:.85;
  width:100%;
  max-width:100%;
}

/* Profile */
.profile{padding:14px; width:100%; max-width:100%}
.profileGrid{
  max-width:var(--max);
  margin:0 auto;
  display:grid;
  gap:14px;
  width:100%;
  max-width:100%;
}
.profileCard{
  border-radius: var(--r28);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  padding:16px;
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.profileTop{display:flex; gap:12px; align-items:flex-start; min-width:0}
.profileTopText{min-width:0}
.big{font-size:20px; font-weight:1000; margin-top:6px}
.profileFacts{display:grid; grid-template-columns:1fr; gap:10px}
.factLabel{font-size:12px; color:var(--muted); font-weight:900}
.factValue{font-weight:900}
.ctaGrid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.list{display:grid; gap:8px}
.li{
  padding:12px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
  font-weight:900;
}
.trustGrid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.trustItem{
  padding:12px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
  font-weight:900;
}
.reviewRow{display:flex; gap:12px; align-items:baseline}
.ratingBig{font-size:34px; font-weight:1000}
.reviewList{display:grid; gap:10px; margin-top:10px}
.review{
  padding:12px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
}
.reviewTop{display:flex; justify-content:space-between; gap:10px}
.reviewName{font-weight:1000}
.reviewText{margin-top:6px; color:var(--muted); line-height:1.35}

.notice{
  margin-top:10px;
  padding:12px;
  border-radius:18px;
  border:1px solid rgba(24,178,107,.25);
  background: rgba(24,178,107,.10);
  color:#0b4b2d;
  font-weight:900;
}

/* Signup chips */
.chipsBox{display:flex; flex-wrap:wrap; gap:8px}
.chipPick{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
  font-weight:1000;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  max-width:100%;
}
.chipPick[data-on="true"]{
  border-color: rgba(22,199,154,.45);
  background: linear-gradient(135deg, rgba(22,199,154,.16), rgba(79,124,255,.10));
}

/* Admin */
.adminCardActions{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.btnDanger{
  border-color: rgba(229,72,77,.30);
  background: rgba(229,72,77,.10);
}
.adminMiniEdit{
  margin-top:10px;
  display:grid;
  gap:10px;
  padding:12px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: rgba(15,18,32,.02);
}

/* form grids */
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px; min-width:0}
.grid3{display:grid; grid-template-columns: 1fr 1fr 1fr; gap:10px; min-width:0}

/* Responsive */
@media (max-width: 520px){
  .grid2, .grid3{grid-template-columns:1fr}
  .heroRow{grid-template-columns:1fr}
  .cardActions{grid-template-columns: 1fr 1fr}
  .topActions{max-width: 60%;}
}

@media (min-width: 900px){
  .heroInner{grid-template-columns: 1.2fr .8fr}
  .cards{grid-template-columns: 1fr 1fr}
  .profileGrid{grid-template-columns: 1fr 1fr}
  .ctaGrid{grid-template-columns:1fr 1fr 1fr 1fr}
  .profileFacts{grid-template-columns:1fr 1fr}
}