:root {
  --bg: #121726;
  --bg-2: #171d30;
  --panel: #1b2238;
  --panel-2: #222a44;
  --line: #2b3454;
  --text: #e9ecf8;
  --muted: #8d96b8;
  --brand: #5b5ef7;
  --brand-2: #7b7eff;
  --white: #f5f6ff;
  --ok: #22c55e;
  --star: #fbbf24;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; direction: ltr; display: inline-block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 10px 18px; border-radius: 12px; transition: transform .15s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 20px -8px var(--brand); }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: var(--panel-2); color: var(--text); }
.btn-ghost:hover { background: var(--line); }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(18, 23, 38, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; }
.nav-links a { padding: 6px 12px; border-radius: 10px; color: var(--muted); }
.nav-links a:hover, .nav-links a.on { color: var(--text); background: var(--panel); }

/* hero */
.hero { background: radial-gradient(900px 400px at 85% -10%, rgba(91, 94, 247, .28), transparent 70%), var(--bg); padding: 56px 0 24px; }
.hero-inner { display: grid; grid-template-columns: 1fr 240px; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
.grad { background: linear-gradient(90deg, var(--brand-2), var(--white)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 620px; }
.hero-logo { width: 240px; border-radius: 40px; box-shadow: 0 30px 80px -30px var(--brand); }
.search { display: flex; gap: 8px; margin: 22px 0 14px; max-width: 560px; }
.search input, .filters input, .filters select {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font: inherit; padding: 10px 14px; border-radius: 12px; outline: none;
}
.search input:focus, .filters input:focus, .filters select:focus { border-color: var(--brand); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 40px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat b { display: block; font-size: 1.6rem; color: var(--white); }
.stat span { color: var(--muted); }

/* sections */
.section { padding: 32px 16px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { color: var(--brand-2); }
.page-title { font-size: 1.8rem; }
.empty { background: var(--panel); border: 1px dashed var(--line); padding: 32px; border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty a { color: var(--brand-2); }

/* categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cat { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; border-radius: 14px; transition: border-color .15s, transform .15s; }
.cat:hover { border-color: var(--brand); transform: translateY(-2px); }
.cat-emoji { font-size: 1.3rem; }
.cat small { margin-inline-start: auto; color: var(--muted); flex-shrink: 0; }
.cat > span:not(.cat-emoji) { white-space: nowrap; }
.cat-emoji { flex-shrink: 0; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { --accent: var(--brand); display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 16px; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-top { display: flex; align-items: center; gap: 12px; }
.card-title { min-width: 0; flex: 1; }
.card-title h3 { font-size: 1.05rem; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { color: var(--muted); margin: 0; font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.4em; }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; border-top: 1px solid var(--line); padding-top: 10px; }
.card-meta .muted { margin-inline-start: auto; }
.rank { font-weight: 700; color: var(--muted); background: var(--panel-2); padding: 2px 10px; border-radius: 999px; font-size: .9rem; }
.rank-top { color: #fff; background: var(--brand); }
.avatar { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); }
.avatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: .8rem; }
.avatar-xl { width: 112px; height: 112px; border-radius: 28px; border: 5px solid var(--bg); font-size: 2rem; }
.avatar-fallback { display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent, var(--brand)), #2d3160); }
.chip { display: inline-block; font-size: .8rem; background: var(--panel-2); color: var(--muted); padding: 2px 10px; border-radius: 999px; }
.chip-accent { background: rgba(91, 94, 247, .2); color: var(--brand-2); }
.chip-tag:hover, a.chip:hover { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; background: var(--ok); border-radius: 50%; margin-inline-end: 5px; vertical-align: middle; }

/* filters / pager */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { flex: 2 1 220px; }
.filters select { flex: 1 1 160px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 24px; color: var(--muted); }
.pager a { color: var(--brand-2); background: var(--panel); padding: 6px 14px; border-radius: 10px; }

/* how */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; margin-bottom: 10px; }
.step h3 { font-size: 1.05rem; margin-bottom: 4px; }
.step p { color: var(--muted); margin: 0; }

/* profile */
.profile { --accent: var(--brand); }
.banner { height: 220px; background: linear-gradient(120deg, var(--accent), #1e2450 70%); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-head { display: flex; align-items: flex-end; gap: 20px; margin-top: -56px; flex-wrap: wrap; }
.profile-title { flex: 1; min-width: 220px; padding-bottom: 6px; }
.profile-title h1 { font-size: 2rem; margin-bottom: 8px; }
.profile-head .btn { margin-bottom: 10px; }
.profile-body { display: grid; grid-template-columns: 1fr 320px; gap: 18px; padding-top: 24px; padding-bottom: 40px; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-size: 1.2rem; }
.desc { white-space: pre-wrap; margin: 0; overflow-wrap: anywhere; }
.side-stats > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.side-stats > div:last-child { border: 0; }
.side-stats span { color: var(--muted); }
.mini { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.mini:hover { background: var(--panel-2); }
.mini span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar { width: 100%; max-width: 30px; background: linear-gradient(to top, var(--accent, var(--brand)), var(--brand-2)); border-radius: 6px 6px 2px 2px; }
.bar-col small { color: var(--muted); font-size: .7rem; }

/* reviews */
.rating-summary { display: flex; gap: 28px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.rating-big { display: flex; flex-direction: column; align-items: center; }
.rating-big b { font-size: 2.6rem; line-height: 1; }
.rating-big small { color: var(--muted); }
.stars { color: var(--star); letter-spacing: 1px; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.dist { flex: 1; min-width: 200px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.dist-bar { flex: 1; height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--star); }
.review { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.review p { margin: 4px 0 0; overflow-wrap: anywhere; }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; font-size: .8rem; }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* footer */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0; color: var(--muted); }
.footer-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; flex: 1; }
.footer-links { display: flex; gap: 8px 16px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }
.notfound { text-align: center; padding: 80px 16px; }
.notfound h1 { font-size: 5rem; color: var(--brand); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { white-space: normal; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-logo { display: none; }
  .profile-body { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 0; row-gap: 6px; }
  .nav-end { margin-inline-start: auto; }
  .nav-links { order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .nav-links a { white-space: nowrap; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v2: i18n, auth, dashboard ---------- */
.lang-ar { font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif; }
.nav-links { margin-inline-start: 8px; margin-inline-end: auto; }
.nav-end { display: flex; align-items: center; gap: 10px; }
.lang-switch { color: var(--muted); font-size: .9rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.lang-switch:hover { color: var(--text); border-color: var(--brand); }
.me { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; max-width: 160px; }
.me img { width: 30px; height: 30px; border-radius: 50%; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
form.inline { display: inline; margin: 0; }
.link { color: var(--brand-2); }
.link:hover { text-decoration: underline; }
.btn-block { width: 100%; justify-content: center; margin: 8px 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--muted); }
.btn-link.danger:hover { color: #f87171; }
.footer-links a.on { color: var(--text); }

.flash { margin-top: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid; }
.flash-ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .4); color: #86efac; }
.flash-error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
.panel .flash { margin: 0 0 14px; }

/* forms */
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-bottom: 16px; }
.form label small { font-weight: 400; }
.form input:not([type=checkbox]), .form select, .form textarea, .review-form textarea {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font: inherit; font-weight: 400;
  padding: 10px 14px; border-radius: 12px; outline: none; width: 100%;
}
.form textarea, .review-form textarea { resize: vertical; line-height: 1.6; }
.form input:focus, .form select:focus, .form textarea:focus, .review-form textarea:focus { border-color: var(--brand); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

/* review form */
.review-form { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 8px 0 12px; }
.review-form h3 { font-size: 1rem; }
.review-form textarea { min-height: 90px; }
.review-form form.inline { display: block; margin-top: 10px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-bottom: 10px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.9rem; line-height: 1; color: var(--line); cursor: pointer; transition: color .1s; }
.star-input:not(:hover) input:checked ~ label,
.star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }

/* profile actions */
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.profile-actions .btn { margin: 0; }

/* dashboard */
.guild-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.guild-row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.guild-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.guild-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { font-size: .85rem; }
.status.ok { color: #4ade80; }
.status.warn { color: #fbbf24; }
.avatar-lg { width: 72px; height: 72px; border-radius: 20px; font-size: 1.4rem; }
.manage .back { display: inline-block; margin-bottom: 14px; }
.manage-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.manage-head > div:not(.avatar) { flex: 1; min-width: 0; }
.manage-head h1 { margin: 0; font-size: 1.6rem; }
.manage-head p { margin: 0; }
.manage-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }

@media (max-width: 860px) {
  .manage-grid { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .me span { display: none; }
  .nav-inner { gap: 10px; }
  .guild-row { flex-wrap: wrap; }
}

/* ---------- v3: dashboard redesign, discovery sections, admin ---------- */
.small { font-size: .85rem; }
.row-between { display: flex; justify-content: space-between; gap: 10px; }
.ok-text { color: #4ade80; }
.input { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font: inherit; padding: 8px 12px; border-radius: 10px; outline: none; min-width: 0; }
.input:focus { border-color: var(--brand); }
.btn-danger { background: rgba(239, 68, 68, .15); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, .28); }
.btn-icon { padding-inline: 12px; }
.count { display: inline-block; min-width: 24px; text-align: center; font-size: .8rem; background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: 1px 8px; vertical-align: middle; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: rgba(34, 197, 94, .14); color: #4ade80; }
.badge-warn { background: rgba(251, 191, 36, .14); color: #fbbf24; }
.badge-danger { background: rgba(239, 68, 68, .14); color: #f87171; }
.badge-featured, .chip-featured { background: rgba(251, 191, 36, .16); color: #fcd34d; }
.dot-ok, .dot-warn, .dot-muted { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; }
.dot-ok { background: #4ade80; } .dot-warn { background: #fbbf24; } .dot-muted { background: var(--muted); }

/* dashboard list */
.dash-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-top p { margin: 0; max-width: 640px; }
.dash-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-tools .input { width: 220px; }
.group-title { font-size: 1.05rem; margin: 28px 0 12px; display: flex; align-items: center; gap: 4px; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.gcard { --accent: var(--brand); display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 16px; min-width: 0; }
.gcard-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.gcard-title { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.gcard-title h3 { margin: 0; font-size: 1.02rem; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gcard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.gcard-stats div { background: var(--bg-2); border-radius: 10px; padding: 8px; text-align: center; min-width: 0; }
.gcard-stats dt { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard-stats dd { margin: 0; font-weight: 700; }
.gcard-bump { font-size: .85rem; color: var(--muted); padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.gcard-bump.ready { color: #4ade80; background: rgba(34, 197, 94, .08); }
.gcard-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.gcard-actions form { margin: 0; }
.gcard-simple { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top-color: #fbbf24; }
.gcard-simple .gcard-head { flex: 1; }
.glist { display: flex; flex-direction: column; gap: 8px; }
.grow { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.grow-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
[hidden] { display: none !important; }

/* manage page */
.mhead { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 3px solid var(--accent); margin-bottom: 14px; }
.mhead-id { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1 1 300px; }
.mhead-title { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mhead-title h1 { margin: 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.mhead-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bump-form { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; text-align: center; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.tile span { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b { font-size: 1.3rem; }
.mgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.mform { display: flex; flex-direction: column; gap: 16px; }
.mform .flash { margin: 0; }
fieldset.panel { margin: 0; min-width: 0; }
fieldset.panel legend { float: left; width: 100%; padding: 0; margin-bottom: 16px; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
fieldset.panel legend + * { clear: both; }
.step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent, var(--brand)); color: #fff; font-size: .85rem; }
.intro-panel h2 { margin-bottom: 4px; }
.intro-panel p { margin: 0; }
.color-field { display: flex; gap: 8px; }
.color-field input[type=color] { width: 46px; min-width: 46px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; }
.preview { margin-bottom: 16px; }
.preview small { display: block; margin-bottom: 6px; }
.preview-card { pointer-events: none; }
.preview-card .card-desc { min-height: 0; }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(27, 34, 56, .92); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.bar-label { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 4px; }
.meter { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; }
[dir=rtl] .meter i { background: linear-gradient(270deg, var(--brand), var(--brand-2)); }
.checklist, .rules, .history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; color: var(--muted); font-size: .92rem; }
.checklist li span { width: 18px; text-align: center; }
.checklist li.done { color: var(--text); }
.checklist li.done span { color: #4ade80; }
.rules li { font-size: .9rem; color: var(--muted); padding-inline-start: 16px; position: relative; }
.rules li::before { content: '•'; position: absolute; inset-inline-start: 0; color: var(--brand-2); }
.history li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.history li:last-child { border: 0; padding: 0; }
.h-action { flex: 1; min-width: 0; }

/* discovery */
.card { position: relative; }
.card-featured { border-color: rgba(251, 191, 36, .45); border-top-color: #fbbf24; background: linear-gradient(180deg, rgba(251, 191, 36, .06), var(--panel) 40%); }
.sponsor-tag { position: absolute; top: -11px; inset-inline-end: 14px; font-size: .72rem; font-weight: 700; color: #1a1300; background: #fbbf24; padding: 2px 10px; border-radius: 99px; }
.section-head p { margin: 0; }
.featured-strip { margin: 8px 0 22px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.featured-strip .grid { margin-top: 14px; }
.report-box summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.report-box[open] summary { margin-bottom: 12px; }
.report-box .form label { margin-bottom: 10px; }

/* admin */
.admin .panel { margin-bottom: 18px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.report-row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.report-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 300px; }
.report-info p { margin: 4px 0 0; overflow-wrap: anywhere; }
.report-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.log { width: 100%; border-collapse: collapse; font-size: .85rem; }
.log th, .log td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.log th { color: var(--muted); font-weight: 600; }

@media (max-width: 960px) {
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dash-tools, .dash-tools .input { width: 100%; }
  .dash-tools .input { flex: 1; }
  .mhead-actions { width: 100%; }
  .mhead-actions > * { flex: 1; }
  .mhead-actions .btn { width: 100%; justify-content: center; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .gcards { grid-template-columns: minmax(0, 1fr); }
  .savebar { bottom: 8px; }
  .savebar .btn { flex: 1; justify-content: center; }
}

.savebar[hidden] { display: none; }
.panel-danger { border-color: rgba(239, 68, 68, .35); }
