:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b675f;
  --line: #e9e5dc;
  --brand: #0f7b4f;
  --brand-ink: #ffffff;
  --brand-soft: #e5f3ec;
  --accent: #c8102e;
  --gold: #b7791f;
  --gold-soft: #fdf3e1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121412; --surface: #1b1e1b; --text: #ecebe6; --muted: #a09d94; --line: #2c302c;
    --brand: #37b37e; --brand-ink: #08130d; --brand-soft: #16271e; --gold-soft: #2a2213;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, "Noto Sans Arabic", system-ui, -apple-system, Segoe UI, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* hero */
.hero {
  background: radial-gradient(1200px 400px at 10% -10%, rgba(15,123,79,.14), transparent 60%),
              radial-gradient(900px 400px at 100% 0%, rgba(200,16,46,.08), transparent 60%);
  border-bottom: 1px solid var(--line); padding-bottom: 28px;
}
.topnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 8px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .ar { font-family: "Noto Sans Arabic", sans-serif; color: var(--muted); font-weight: 500; font-size: 15px; }
.navlinks { display: flex; align-items: center; gap: 14px; }
.navlinks > a:not(.btn) { color: var(--muted); text-decoration: none; }
h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.1; letter-spacing: -.02em; margin: 26px 0 10px; }
.sub { color: var(--muted); max-width: 620px; margin: 0 0 20px; font-size: 16px; }
.searchbar {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 8px 6px 18px; box-shadow: var(--shadow); max-width: 720px;
}
.searchbar svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.searchbar input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 10px 0; min-width: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.stats b { color: var(--text); }
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 6px; box-shadow: 0 0 0 0 rgba(15,123,79,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(15,123,79,0); } 100% { box-shadow: 0 0 0 0 rgba(15,123,79,0); } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink);
  border: 1px solid var(--brand); border-radius: 999px; padding: 10px 18px; font-weight: 600; text-decoration: none; cursor: pointer; font: inherit; font-weight: 600;
}
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn:hover { filter: brightness(1.05); }

/* toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.tabs { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--text); color: var(--bg); }
.tab span { font-weight: 500; opacity: .75; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip small { opacity: .65; margin-left: 4px; }

/* grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid.products { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0;
}
.shop { cursor: pointer; transition: transform .12s ease; }
.shop:hover { transform: translateY(-2px); }
.shop.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.cover { aspect-ratio: 16/8; background: var(--brand-soft) center/cover no-repeat; position: relative; }
.cover .ico { display: grid; place-items: center; font-weight: 700; color: var(--brand); position: absolute; left: 14px; bottom: -18px; width: 42px; height: 42px; border-radius: 10px; background: var(--surface) center/70% no-repeat; border: 1px solid var(--line); }
.cover .initial { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 700; color: var(--brand); opacity: .5; }
.shop .body { padding: 24px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.shop h3 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.domain { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }
.tag { font-size: 12px; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 2px 7px; }
.tag.gray { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.badge { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface); }
.badge.feat { background: var(--gold); color: #fff; }
.badge.new { background: var(--accent); color: #fff; }

.product { text-decoration: none; }
.product .pimg { aspect-ratio: 1; background: var(--brand-soft) center/cover no-repeat; }
.product .pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.product .ptitle { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 13px; }
.pshop { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oos { color: var(--accent); font-size: 12px; }

.more { display: flex; justify-content: center; margin: 22px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* owners */
.owners { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 40px 0 20px; }
.owner-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.owner-card.accent { background: var(--gold-soft); border-color: transparent; }
.owner-card h2 { margin: 0 0 8px; font-size: 20px; }
.owner-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.plans { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.plans li { display: flex; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.pay-howto { font-size: 14px; color: var(--muted); margin: 0; }

.botlog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 10px 0 30px; }
.botlog summary { cursor: pointer; font-weight: 600; }
.run { display: flex; gap: 10px; font-size: 13.5px; padding: 6px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.run time { color: var(--muted); min-width: 90px; }

.footer { color: var(--muted); font-size: 13px; padding-bottom: 40px; }

/* dialog */
dialog { border: 0; padding: 0; border-radius: 18px; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dlg { padding: 22px; position: relative; }
.close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; line-height: 1; }
.dlg-head { display: flex; gap: 14px; align-items: center; padding-right: 30px; }
.dlg-head .ico { display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--brand); width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--brand-soft) center/70% no-repeat; flex: none; }
.dlg-head h2 { margin: 0; font-size: 22px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.dlg .grid.products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.claim { font-size: 13px; color: var(--muted); margin-top: 16px; }

@media (max-width: 560px) {
  .navlinks > a:not(.btn) { display: none; }
  h1 br { display: none; }
  .grid { grid-template-columns: 1fr; }
  .grid.products, .dlg .grid.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tabs { justify-content: space-between; }
  .tab { flex: 1; }
  .filters select { flex: 1; min-width: 0; }
}
