:root{
  --bg: #f5f7ff;
  --bg2:#eef2ff;
  --text: rgba(10,14,25,.92);
  --muted: rgba(10,14,25,.62);

  --surface: rgba(255,255,255,.78);
  --card: rgba(255,255,255,.92);

  --stroke: rgba(10,14,25,.10);
  --stroke2: rgba(10,14,25,.14);

  --shadow: rgba(10,14,25,.14);

  --glowA: rgba(90, 90, 255, .18);
  --glowB: rgba(255, 80, 160, .14);
  --glowC: rgba(0, 220, 180, .12);

  --gridA: rgba(10,14,25,.05);
  --gridB: rgba(10,14,25,.04);

  --radius: 24px;

  --control-height: 48px;
  --control-radius: 16px;
}

html[data-theme="dark"]{
  --bg: #06070b;
  --bg2:#0b1020;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);

  --surface: rgba(255,255,255,.03);
  --card: rgba(255,255,255,.06);

  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);

  --shadow: rgba(0,0,0,.55);

  --glowA: rgba(90, 90, 255, .35);
  --glowB: rgba(255, 80, 160, .25);
  --glowC: rgba(0, 220, 180, .22);

  --gridA: rgba(255,255,255,.05);
  --gridB: rgba(255,255,255,.04);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 15% 20%, var(--glowB), transparent 60%),
    radial-gradient(1000px 700px at 85% 30%, var(--glowA), transparent 55%),
    radial-gradient(900px 600px at 50% 90%, var(--glowC), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  overflow-x:hidden;
}

.gridbg{
  position:fixed; inset:0;
  background:
    linear-gradient(to right, var(--gridA) 1px, transparent 1px),
    linear-gradient(to bottom, var(--gridB) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(900px 520px at 50% 30%, black 50%, transparent 80%);
  opacity:.25;
  pointer-events:none;
}

.wrap{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:42px 18px;
}
.shell{ width:min(1200px, 100%); }

header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
  flex-wrap:wrap;
}

.brand{
  display:flex;
  flex-direction:column;
  gap:6px;
  flex: 1 1 360px;
  min-width: 260px;
}
.brand .title{
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing:.2px;
  display:flex; align-items:center; gap:10px;
  margin:0;
}
.dot{
  width:10px; height:10px; border-radius:999px;
  background: linear-gradient(135deg, rgba(90,90,255,.9), rgba(255,80,160,.9));
  box-shadow: 0 0 0 6px rgba(255,255,255,.20), 0 0 30px rgba(90,90,255,.18);
}
html[data-theme="dark"] .dot{
  box-shadow: 0 0 0 6px rgba(255,255,255,.06), 0 0 30px rgba(90,90,255,.25);
}
.brand .sub{
  margin:0;
  color:var(--muted);
  font-size: 14px;
  line-height:1.35;
  max-width: 78ch;
}

.right{
  display:flex;
  gap:10px;
  align-items:flex-end;
  justify-content:flex-end;
  flex: 1 1 520px;
  min-width: 260px;
}

/* Search block */
.searchBlock{
  width: min(560px, 100%);
  display:flex;
  flex-direction:column;
  gap:0;
  align-items:stretch;
}
.search{
  display:flex;
  align-items:center;
  gap:10px;
  border-radius: var(--control-radius);
  border: 1px solid var(--stroke2);
  background: var(--card);
  padding: 0 12px;
  width:100%;
  height: var(--control-height);
}
.searchIcon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid; place-items:center;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.6);
  flex: 0 0 auto;
}
html[data-theme="dark"] .searchIcon{ background: rgba(255,255,255,.08); }
.search input{
  width:100%;
  border:none;
  outline:none;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  height: 100%;
  padding: 0;
}
.search input::placeholder{ color: color-mix(in oklab, var(--muted) 92%, transparent); }

.toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 0 12px;
  border-radius: var(--control-radius);
  background: var(--card);
  border: 1px solid var(--stroke2);
  user-select:none;
  cursor:pointer;
  flex: 0 0 auto;
  white-space:nowrap;
  height: var(--control-height);
  line-height: 1;
}
.toggleLabel{
  font-size: 13px;
  color: color-mix(in oklab, var(--text) 78%, transparent);
  line-height: 1;
  display:inline-flex;
  align-items:center;
  height: 100%;
}
.switch{
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,.08);
  position:relative;
  display:block;
  flex: 0 0 auto;
}
html[data-theme="dark"] .switch{ background: rgba(0,0,0,.22); }
.knob{
  position:absolute;
  left: 3px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(90,90,255,.85), rgba(255,80,160,.80));
  transform: translateY(-50%) translateX(0);
  box-shadow: 0 10px 24px rgba(10,14,25,.14);
}
html[data-theme="dark"] .knob{
  transform: translateY(-50%) translateX(18px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

/* Install button styling */
.installBtn{
  justify-content:space-between;
  min-width: 160px;
}
.installIcon{
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.65);
  font-size: 16px;
  line-height: 1;
}
html[data-theme="dark"] .installIcon{ background: rgba(255,255,255,.08); }

/* Quicktags */
.chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  margin: 0;
  padding: 0;
  list-style:none;
  margin-top: 0;
  opacity: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.searchBlock:focus-within .chips,
.searchBlock.is-armed .chips{
  margin-top: 8px;
  opacity: 1;
  height: auto;
  overflow: visible;
  pointer-events: auto;
}
.chip{
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.55);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12.5px;
  cursor:pointer;
  user-select:none;
  color: color-mix(in oklab, var(--text) 78%, transparent);
  line-height:1;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
html[data-theme="dark"] .chip{ background: rgba(255,255,255,.07); }
.chipDot{
  width:7px; height:7px; border-radius:999px;
  background: linear-gradient(135deg, rgba(90,90,255,.9), rgba(255,80,160,.85));
  opacity:.9;
}
.chipActive{
  background: color-mix(in oklab, var(--card) 70%, rgba(90,90,255,.12));
  border-color: color-mix(in oklab, var(--stroke2) 40%, rgba(90,90,255,.55));
  color: var(--text);
}

.panel{
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  overflow:hidden;
  box-shadow: 0 30px 90px var(--shadow);
  backdrop-filter: blur(14px);
  padding: 14px;
}

.grid{ display:grid; grid-template-columns: 1fr; gap: 12px; }

.parent{
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--surface) 78%, transparent);
  overflow:hidden;
}

.parent a{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding: 18px 18px;
  text-decoration:none;
  color:inherit;
  background: color-mix(in oklab, var(--card) 60%, transparent);
}

.pLeft{
  display:flex;
  align-items:flex-start;
  gap:14px;
  min-width: 240px;
  flex: 1 1 auto;
}

.pLogo{
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.65);
  display:grid;
  place-items:center;
  overflow:hidden;
  flex: 0 0 auto;
  position: relative;
}
html[data-theme="dark"] .pLogo{ background: rgba(255,255,255,.08); }

.pLogo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  filter: saturate(1.05);
}
html[data-theme="dark"] .pLogo img{
  filter: brightness(1.08) contrast(1.02);
}

.pColor{
  width:100%;
  height:100%;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(90,90,255,.92), rgba(255,80,160,.82));
  box-shadow: 0 0 60px rgba(90,90,255,.14);
}

.pTitle{ margin:0 0 6px 0; font-size: 20px; letter-spacing:.2px; }
.pHost{ margin:0 0 6px 0; color: color-mix(in oklab, var(--text) 82%, transparent); font-size: 14px; }
.pDesc{ margin:0; color: var(--muted); font-size: 13.5px; line-height: 1.45; max-width: 76ch; }

.pRight{ display:flex; align-items:center; gap:10px; flex: 0 0 auto; }
.pill{
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.65);
  font-size: 12px;
  color: color-mix(in oklab, var(--text) 72%, transparent);
  user-select:none;
  white-space:nowrap;
}
html[data-theme="dark"] .pill{ background: rgba(255,255,255,.08); }

.go{
  width: 40px;
  height: 40px;
  border-radius: 16px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.65);
  display:grid;
  place-items:center;
  user-select:none;
  font-size: 14px;
}
html[data-theme="dark"] .go{ background: rgba(255,255,255,.08); }

.childrenWrap{
  border-top: 1px solid var(--stroke);
  padding: 14px;
  background: color-mix(in oklab, var(--surface) 82%, transparent);
}

.childHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding: 2px 4px 12px 4px;
}
.childTitle{
  margin:0;
  font-size: 13px;
  letter-spacing:.35px;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--text) 75%, transparent);
}
.childSub{ margin:0; font-size: 13px; color: var(--muted); }

.children{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.child{
  grid-column: span 4;
  border-radius: 18px;
  border: 1px solid var(--stroke2);
  background: var(--card);
  overflow:hidden;
}
.child a{ display:block; color: inherit; text-decoration:none; }

.cHeader{
  height: 140px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255,255,255,.65);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px;
}
html[data-theme="dark"] .cHeader{ background: rgba(255,255,255,.06); }

.cHeader img{
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display:block;
}

.cHeader.placeholder{
  background: linear-gradient(135deg, rgba(120,120,255,.35), rgba(255,120,180,.28));
}

.cBody{
  padding: 12px 12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.cText{ min-width: 200px; flex: 1 1 auto; }

.cName{ margin:0 0 6px 0; font-size: 15px; letter-spacing:.2px; }
.cUrl{
  margin:0 0 6px 0;
  font-size: 12.5px;
  color: color-mix(in oklab, var(--text) 72%, transparent);
  word-break: break-word;
}
.cDesc{ margin:0; font-size: 12.8px; color: var(--muted); line-height:1.35; }

.cRight{ display:flex; align-items:center; gap:10px; flex: 0 0 auto; }
.cStatus{
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.65);
  font-size: 12px;
  color: color-mix(in oklab, var(--text) 70%, transparent);
  user-select:none;
  white-space:nowrap;
}
html[data-theme="dark"] .cStatus{ background: rgba(255,255,255,.08); }

.cGo{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,.65);
  display:grid;
  place-items:center;
  user-select:none;
  font-size: 14px;
}
html[data-theme="dark"] .cGo{ background: rgba(255,255,255,.08); }

#empty{
  display:none;
  padding: 12px 6px 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* Mobile */
@media (max-width: 760px){
  .wrap{ padding: 28px 14px; }
  header{ gap: 12px; align-items:stretch; }
  .brand{ min-width: 0; }
  .brand .sub{ font-size: 13.5px; }

  .right{
    width: 100%;
    min-width: 0;
    justify-content:stretch;
    align-items:stretch;
    gap:10px;

    display:grid;
    grid-template-columns: 1fr auto;
    align-items:end;
  }

  .searchBlock{ width: 100%; }
  .chips{ justify-content:flex-start; }

  /* iOS Safari: prevent zoom */
  .search input{ font-size: 16px; }
}

@media (max-width: 520px){
  .right{ grid-template-columns: 1fr; }
  .toggle{ width: 100%; justify-content:space-between; }
  .installBtn{ min-width: 0; }
}

@media (max-width: 1020px){
  .child{ grid-column: span 6; }
  .cHeader{ height: 160px; }
  .right{ justify-content:flex-start; }
  .chips{ justify-content:flex-start; }
}
@media (max-width: 700px){
  .child{ grid-column: span 12; }
  .pLogo{ width:56px; height:56px; border-radius: 18px; }
  .cHeader{ height: 180px; }
}

footer{
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
  color: color-mix(in oklab, var(--text) 55%, transparent);
  font-size: 12.5px;
  padding: 14px 4px 0;
}
footer a{color: color-mix(in oklab, var(--text) 72%, transparent); text-decoration:none}
footer a:hover{text-decoration:underline}

/* Toast */
.toastWrap{
  position: fixed;
  inset: auto 14px 14px 14px;
  display:flex;
  justify-content:center;
  pointer-events:none;
  z-index: 50;
}
.toast{
  pointer-events:auto;
  width: min(720px, 100%);
  border-radius: 18px;
  border: 1px solid var(--stroke2);
  background: color-mix(in oklab, var(--card) 84%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px var(--shadow);
  padding: 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.toastLeft{ display:flex; flex-direction:column; gap:2px; }
.toastTitle{ font-size: 13.5px; margin:0; }
.toastSub{ font-size: 12.5px; margin:0; color: var(--muted); }
.toastActions{ display:flex; gap:8px; align-items:center; }
.btn{
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.55);
  border-radius: 14px;
  padding: 9px 10px;
  font-size: 12.5px;
  cursor:pointer;
  user-select:none;
  color: color-mix(in oklab, var(--text) 86%, transparent);
}
html[data-theme="dark"] .btn{ background: rgba(255,255,255,.08); }
.btnPrimary{
  background: color-mix(in oklab, rgba(90,90,255,.18) 40%, var(--card));
  border-color: color-mix(in oklab, var(--stroke2) 40%, rgba(90,90,255,.55));
}
.btnGhost{ background: transparent; }

/* Keep it crisp (no animations) */
* { transition:none !important; }