/**
 * Downloadgram Mini App — Compact Mobile Instagram Glassmorphism (Telegram WebApp).
 */
@font-face {
  font-family: "Vazirmatn";
  src: url("/mini/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/mini/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/mini/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/mini/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07060c;
  --fg: #f8f7fb;
  --muted: #aba4be;
  --accent: #ff2d78;
  --accent-2: #ff8a3d;
  --accent-3: #a855f7;
  --ig-grad: linear-gradient(135deg, #ff8a3d 0%, #ef2b7a 52%, #8b3dff 100%);
  --surface: rgba(24, 20, 36, 0.5);
  --glass: rgba(30, 24, 46, 0.62);
  --glass-2: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.13);
  --ok: #86efac;
  --warn: #fcd34d;
  --radius: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: calc(62px + var(--safe-b));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: dark; scroll-behavior: smooth; }
.is-hidden { display: none !important; }
body {
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "SF Pro Text", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 12.5px;
  -webkit-font-smoothing: antialiased;
  padding: calc(4px + var(--safe-t)) 0 var(--nav-h);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 42% at 88% -6%, rgba(239, 43, 122, 0.26), transparent 58%),
    radial-gradient(ellipse 68% 36% at 10% 16%, rgba(255, 138, 61, 0.15), transparent 54%),
    radial-gradient(ellipse 84% 46% at 50% 98%, rgba(139, 61, 255, 0.22), transparent 58%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 452px;
  margin: 0 auto;
  padding: 8px 11px 10px;
}

.glass {
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid var(--stroke);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.hero-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.theme-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.theme-btn .ic-moon { display: none; }
html[data-theme="light"] .theme-btn .ic-sun { display: none; }
html[data-theme="light"] .theme-btn .ic-moon { display: block; }
.theme-btn .ic-sun { color: #fcd34d; }
.theme-btn .ic-moon { color: #7c3aed; }
.theme-btn:active svg { transform: rotate(28deg) scale(0.88); }
.brand {
  display: flex;
  gap: 9px;
  align-items: center;
}
.logo-img {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 6px 16px rgba(239, 43, 122, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  flex: 0 0 auto;
}
.social-strip {
  position: relative;
  border-radius: 16px;
  padding: 6px 7px;
  margin-bottom: 10px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.11), rgba(239, 43, 122, 0.06) 52%, rgba(20, 16, 30, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.social-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 1px 0;
}
.social-row::-webkit-scrollbar { display: none; }
.soc-item {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  text-decoration: none;
  font: inherit;
  min-width: 50px;
  padding: 4px 5px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  scroll-snap-align: start;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.soc-item:active,
.soc-item.on {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
}
.soc-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}
.soc-ic svg {
  width: 17px;
  height: 17px;
  display: block;
}
.soc-ic.soc-tiktok {
  background: #0d0d12;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.soc-ic.soc-youtube { background: linear-gradient(145deg, #ff1e1e, #cc0000); }
.soc-ic.soc-pinterest { background: linear-gradient(145deg, #f0002a, #bd081c); }
.soc-ic.soc-twitter {
  background: #0f1419;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.soc-ic.soc-facebook { background: linear-gradient(145deg, #2b86ff, #166fe5); }
.soc-ic.soc-spotify { background: linear-gradient(145deg, #1ed760, #169c46); color: #0b0b0f; }
.soc-ic.soc-soundcloud { background: linear-gradient(180deg, #ff7a00, #ff3b00); }
.soc-ic.soc-reddit { background: linear-gradient(145deg, #ff571a, #e03700); }
.soc-ic.soc-twitch { background: linear-gradient(145deg, #a25cff, #772ce8); }
.soc-ic.soc-telegram { background: linear-gradient(180deg, #37aee2, #1e96c8); }
.soc-ic.soc-dailymotion { background: linear-gradient(145deg, #1280ff, #0058c6); }
.soc-ic.soc-snapchat { background: #fffc00; color: #111; }
.soc-ic.soc-threads {
  background: #121216;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.soc-ic.soc-vimeo { background: linear-gradient(145deg, #27c7f9, #129ec9); }
.soc-ic.soc-likee { background: linear-gradient(135deg, #ff4b72, #ff9f2e); }
.soc-lbl {
  font-size: 9px;
  font-weight: 600;
  color: rgba(246, 245, 251, 0.82);
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.hero h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--fg);
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.12s ease, background 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.16); }
.mini-close { opacity: 0.9; }

.search {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px;
  border-radius: 999px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.065);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.search:focus-within {
  background: rgba(30, 24, 46, 0.72);
  border-color: rgba(255, 45, 120, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.14), 0 12px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  padding: 7px 8px;
  outline: none;
  min-width: 0;
}
.search input::placeholder { color: var(--muted); }
.search button[type="submit"] {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  background: var(--ig-grad);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  box-shadow: 0 4px 14px rgba(239, 43, 122, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.search button[type="submit"]:active { transform: scale(0.96); filter: brightness(1.06); }
.search button[type="submit"] svg { width: 14px; height: 14px; flex: 0 0 auto; }
.search-clear {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-left: 3px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}
.search-clear:active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.search button:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--stroke);
  background: var(--glass-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(12px);
}
.chip.on, .chip:hover {
  color: #fff;
  border-color: rgba(244, 63, 142, 0.48);
  background: linear-gradient(135deg, rgba(245, 133, 41, 0.18), rgba(221, 42, 123, 0.24), rgba(129, 52, 175, 0.22));
}

.flash {
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.65;
}
.flash.warn { color: var(--warn); }
.flash.ok { color: var(--ok); }
.flash a { color: inherit; font-weight: 700; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.stats-top { margin: 12px 0 0; }
.stat {
  border-radius: 13px;
  padding: 8px 6px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
a.stat:active { transform: scale(0.97); border-color: rgba(244, 63, 142, 0.45); }
.stat b { display: block; font-size: 15px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 10px; }

.profile {
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
}
.profile-top {
  display: flex;
  gap: 10px;
  align-items: center;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.privacy-pill {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.bio-box {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-line;
}
.ext-link {
  margin-top: 6px;
  color: #f9a8d4;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  background: var(--ig-grad);
  border: 2px solid rgba(244, 63, 142, 0.65);
  box-shadow: 0 0 0 2px rgba(245, 133, 41, 0.22);
  flex: 0 0 auto;
}
.profile h2 { margin: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.profile .handle { color: var(--muted); font-size: 11.5px; direction: ltr; text-align: right; margin-top: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn.full-w, .jump-btn { width: 100%; }
.jump-btn {
  margin-top: 10px;
  font-weight: 700;
  gap: 6px;
}
.jump-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.note-pill {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(244, 63, 142, 0.09);
  border: 1px solid rgba(244, 63, 142, 0.22);
  color: #fbcfe8;
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
}
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.act-tile {
  justify-content: flex-start;
  text-align: right;
  padding: 8px 9px;
  gap: 8px;
  border-radius: 12px;
}
.act-tile.full { justify-content: center; }
.gic {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fda4af;
}
.btn.primary .gic {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.gic svg, .card-acts .btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.btn {
  appearance: none;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  padding: 8px 10px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  background: var(--glass-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  min-width: 0;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.actions-grid .btn.full { grid-column: 1 / -1; }
.btn.primary {
  background: var(--ig-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(221, 42, 123, 0.25);
}
.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
  background: var(--glass-2);
  color: var(--muted);
  border-color: var(--stroke);
}
.hint { color: var(--muted); font-size: 10.5px; margin-top: 8px; line-height: 1.65; }

.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
}
.section-h h3 { margin: 0; font-size: 13px; font-weight: 700; }
.section-h span { color: var(--muted); font-size: 10.5px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.tile {
  border-radius: 14px;
  padding: 7px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: right;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
  min-width: 0;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.tile:active { transform: scale(0.96); border-color: rgba(255, 45, 120, 0.48); background: rgba(255, 255, 255, 0.08); }
.tile-txt { min-width: 0; flex: 1; }
.tile b { display: block; font-size: 11px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile span { color: var(--muted); font-size: 9px; display: block; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .ic {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.2), rgba(239, 43, 122, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fda4af;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.tile .ic svg { width: 14px; height: 14px; }

.cap-hint {
  border-radius: 13px;
  padding: 7px 10px;
  margin: -2px 0 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: #fbcfe8;
  border-color: rgba(255, 45, 120, 0.4);
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.13), rgba(168, 85, 247, 0.13));
  line-height: 1.5;
}
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5.5px;
  margin-bottom: 12px;
}
.cap-card {
  appearance: none;
  font: inherit;
  color: inherit;
  border-radius: 15px;
  padding: 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.cap-card:active { transform: scale(0.95); }
.cap-card.on {
  border-color: rgba(255, 45, 120, 0.62);
  background: linear-gradient(145deg, rgba(255, 138, 61, 0.15), rgba(239, 43, 122, 0.22), rgba(139, 61, 255, 0.2));
}
.cap-card.ai .cic {
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.28), rgba(168, 85, 247, 0.32));
  border-color: rgba(255, 255, 255, 0.24);
  color: #fbcfe8;
}
.cap-card .cic {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.18), rgba(239, 43, 122, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fda4af;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.cap-card .cic svg { width: 15px; height: 15px; }
.cap-card b {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 5px;
  line-height: 1.3;
}
.cap-card span:last-child {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 1px;
  line-height: 1.25;
}

.list { display: flex; flex-direction: column; gap: 6px; }
.card {
  border-radius: 14px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  color: inherit;
}
.card.with-acts {
  grid-template-columns: 30px 1fr auto;
  grid-template-rows: auto auto auto;
}
.card.with-acts .rank { grid-row: 1; }
.card.with-acts .card-main {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card.with-acts .card-body { grid-row: 1; min-width: 0; flex: 1; }
.post-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}
.card.with-acts .badge { grid-row: 1; }
.card.with-acts .card-acts {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.profile .card-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.card-acts .btn { flex: 1; justify-content: center; padding: 7px 8px; font-size: 11px; }
.card.with-acts .card-tools {
  grid-column: 1 / -1;
  grid-row: 3;
}
.card-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}
.tchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.tchip svg { width: 13px; height: 13px; flex: 0 0 auto; color: #fda4af; }
.tchip:active { transform: scale(0.96); background: rgba(255, 255, 255, 0.1); }
.tchip.ai {
  background: linear-gradient(135deg, rgba(244, 63, 142, 0.14), rgba(168, 85, 247, 0.16));
  border-color: rgba(244, 63, 142, 0.3);
  color: #fbcfe8;
}
.tchip.ai svg { color: #fbcfe8; }
.rank {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
}
.rank.gold { background: rgba(251, 191, 36, 0.16); color: #fcd34d; }
.rank.silver { background: rgba(148, 163, 184, 0.16); color: #e2e8f0; }
.rank.bronze { background: rgba(217, 119, 87, 0.16); color: #fdba74; }
.card .ttl {
  font-size: 12px;
  font-weight: 600;
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.card .meta { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.badge {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.14);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.28);
  white-space: nowrap;
}
.badge.photo {
  background: rgba(244, 63, 142, 0.14);
  color: #f9a8d4;
  border-color: rgba(244, 63, 142, 0.28);
}

.empty {
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.guide { border-radius: 16px; padding: 12px; margin-bottom: 8px; }
.guide h3 { margin: 0 0 8px; font-size: 14px; }
.guide ol { margin: 0; padding: 0 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.guide li { margin-bottom: 3px; }
.guide-grid {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.guide-item {
  border-radius: 12px;
  padding: 10px 12px;
}
.guide-item b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.guide-item span { color: var(--muted); font-size: 11.5px; line-height: 1.6; }

.nav {
  position: fixed;
  left: 12px;
  right: 12px;
  max-width: 428px;
  margin: 0 auto;
  bottom: calc(8px + var(--safe-b));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 22px;
  background: rgba(18, 15, 28, 0.78);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.nav a {
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 4px;
  border-radius: 17px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.nav a:active { transform: scale(0.95); }
.nav a.on {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.22), rgba(239, 43, 122, 0.3), rgba(139, 61, 255, 0.28));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(239, 43, 122, 0.16);
}
.nav a svg {
  display: block;
  margin: 0 auto 2px;
  width: 17px;
  height: 17px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(9, 8, 15, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  place-items: center;
  padding: 20px;
}
body.busy .overlay { display: grid; }
.overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(24, 18, 34, 0.82);
  border: 1px solid rgba(244, 63, 142, 0.35);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  text-align: center;
  max-width: 280px;
}
.overlay-msg {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.6;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: #f43f8e;
  border-right-color: #fb923c;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

@media (max-width: 340px) {
  .tiles { grid-template-columns: 1fr; }
  .actions-grid { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 29px;
  padding: 0 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font-size: 11.5px;
  text-decoration: none;
}
.pg.on {
  background: var(--ig-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.pg.off { opacity: 0.45; }
.pg-dots { color: var(--muted); padding: 0 3px; font-size: 11px; }

#tg-toast {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(24, 18, 34, 0.94);
  border: 1px solid rgba(244, 63, 142, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
}
#tg-toast.show { display: block; }

/* ───────── Light Mode (Pearl Liquid Glass) ───────── */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3fa;
  --fg: #181326;
  --muted: #685f7d;
  --surface: rgba(255, 255, 255, 0.78);
  --glass: rgba(255, 255, 255, 0.88);
  --glass-2: rgba(24, 19, 38, 0.045);
  --stroke: rgba(24, 19, 38, 0.09);
  --ok: #15803d;
  --warn: #b45309;
}
body, .glass, .nav, .search, .icon-btn {
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 84% 44% at 88% -6%, rgba(239, 43, 122, 0.14), transparent 58%),
    radial-gradient(ellipse 72% 38% at 10% 16%, rgba(255, 138, 61, 0.13), transparent 54%),
    radial-gradient(ellipse 86% 48% at 50% 98%, rgba(139, 61, 255, 0.13), transparent 58%);
}
html[data-theme="light"] .glass {
  box-shadow:
    0 8px 24px rgba(32, 20, 62, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(24, 19, 38, 0.03);
}
html[data-theme="light"] .logo-img {
  border-color: rgba(239, 43, 122, 0.22);
  box-shadow: 0 6px 16px rgba(239, 43, 122, 0.22);
}
html[data-theme="light"] .icon-btn {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(24, 19, 38, 0.1);
  color: #352b4c;
  box-shadow: 0 4px 12px rgba(32, 20, 62, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
html[data-theme="light"] .icon-btn:active {
  background: rgba(239, 43, 122, 0.1);
}
html[data-theme="light"] .search {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(24, 19, 38, 0.1);
}
html[data-theme="light"] .search:focus-within {
  background: #ffffff;
  border-color: rgba(239, 43, 122, 0.45);
  box-shadow: 0 0 0 3px rgba(239, 43, 122, 0.12), 0 10px 26px rgba(32, 20, 62, 0.08);
}
html[data-theme="light"] .search-clear {
  background: rgba(24, 19, 38, 0.07);
  color: var(--muted);
}
html[data-theme="light"] .search-clear:active {
  background: rgba(24, 19, 38, 0.14);
  color: var(--fg);
}
html[data-theme="light"] .social-strip {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(255, 241, 248, 0.82) 52%, rgba(244, 240, 255, 0.86));
  border-color: rgba(239, 43, 122, 0.13);
  box-shadow: 0 8px 22px rgba(32, 20, 62, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
html[data-theme="light"] .soc-item {
  background: rgba(24, 19, 38, 0.025);
}
html[data-theme="light"] .soc-item:active,
html[data-theme="light"] .soc-item.on {
  background: rgba(239, 43, 122, 0.09);
  border-color: rgba(239, 43, 122, 0.24);
}
html[data-theme="light"] .soc-lbl {
  color: #3a3150;
}
html[data-theme="light"] .tile .ic,
html[data-theme="light"] .cap-card .cic,
html[data-theme="light"] .gic {
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.14), rgba(239, 43, 122, 0.16));
  border-color: rgba(239, 43, 122, 0.16);
  color: #d91c69;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
html[data-theme="light"] .cap-card.ai .cic {
  background: linear-gradient(135deg, rgba(239, 43, 122, 0.18), rgba(139, 61, 255, 0.2));
  border-color: rgba(139, 61, 255, 0.22);
  color: #9333ea;
}
html[data-theme="light"] .cap-card.on {
  border-color: rgba(239, 43, 122, 0.48);
  background: linear-gradient(145deg, rgba(255, 138, 61, 0.11), rgba(239, 43, 122, 0.14), rgba(139, 61, 255, 0.12));
}
html[data-theme="light"] .tile:active {
  background: rgba(239, 43, 122, 0.07);
}
html[data-theme="light"] .cap-hint,
html[data-theme="light"] .note-pill {
  color: #9d174d;
  background: linear-gradient(135deg, rgba(239, 43, 122, 0.09), rgba(168, 85, 247, 0.09));
  border-color: rgba(239, 43, 122, 0.24);
}
html[data-theme="light"] .chip {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(24, 19, 38, 0.1);
  color: #4b4263;
}
html[data-theme="light"] .chip.on,
html[data-theme="light"] .chip:hover {
  color: #ffffff;
  border-color: transparent;
  background: var(--ig-grad);
  box-shadow: 0 4px 12px rgba(239, 43, 122, 0.24);
}
html[data-theme="light"] .btn {
  background: rgba(24, 19, 38, 0.045);
  border-color: rgba(24, 19, 38, 0.1);
  color: var(--fg);
}
html[data-theme="light"] .btn.primary {
  background: var(--ig-grad);
  color: #ffffff;
  border-color: transparent;
}
html[data-theme="light"] .btn.primary .gic {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
html[data-theme="light"] .tchip {
  background: rgba(24, 19, 38, 0.035);
  border-color: rgba(24, 19, 38, 0.09);
  color: #2b233e;
}
html[data-theme="light"] .tchip svg { color: #d91c69; }
html[data-theme="light"] .tchip:active { background: rgba(24, 19, 38, 0.08); }
html[data-theme="light"] .tchip.ai {
  background: linear-gradient(135deg, rgba(239, 43, 122, 0.1), rgba(168, 85, 247, 0.12));
  border-color: rgba(168, 85, 247, 0.24);
  color: #7e22ce;
}
html[data-theme="light"] .tchip.ai svg { color: #9333ea; }
html[data-theme="light"] .rank {
  background: rgba(24, 19, 38, 0.05);
  border-color: rgba(24, 19, 38, 0.09);
  color: #3a3150;
}
html[data-theme="light"] .rank.gold { background: rgba(245, 158, 11, 0.16); border-color: rgba(217, 119, 6, 0.28); color: #b45309; }
html[data-theme="light"] .rank.silver { background: rgba(100, 116, 139, 0.14); border-color: rgba(100, 116, 139, 0.24); color: #475569; }
html[data-theme="light"] .rank.bronze { background: rgba(234, 88, 12, 0.13); border-color: rgba(194, 65, 12, 0.24); color: #9a3412; }
html[data-theme="light"] .post-thumb {
  border-color: rgba(24, 19, 38, 0.12);
  background: rgba(24, 19, 38, 0.05);
  box-shadow: 0 3px 10px rgba(32, 20, 62, 0.1);
}
html[data-theme="light"] .badge {
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.24);
}
html[data-theme="light"] .badge.photo {
  background: rgba(239, 43, 122, 0.1);
  color: #be185d;
  border-color: rgba(239, 43, 122, 0.24);
}
html[data-theme="light"] .bio-box,
html[data-theme="light"] .privacy-pill {
  background: rgba(24, 19, 38, 0.035);
  border-color: rgba(24, 19, 38, 0.08);
  color: #4b4263;
}
html[data-theme="light"] .ext-link { color: #be185d; }
html[data-theme="light"] .pg {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(24, 19, 38, 0.1);
  color: var(--fg);
}
html[data-theme="light"] .pg.on {
  background: var(--ig-grad);
  border-color: transparent;
  color: #ffffff;
}
html[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(24, 19, 38, 0.09);
  box-shadow: 0 12px 32px rgba(32, 20, 62, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}
html[data-theme="light"] .nav a { color: #5b5270; }
html[data-theme="light"] .nav a.on {
  color: #ffffff;
  background: var(--ig-grad);
  box-shadow: 0 5px 14px rgba(239, 43, 122, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
html[data-theme="light"] .overlay {
  background: rgba(246, 243, 250, 0.62);
}
html[data-theme="light"] .overlay-box {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(239, 43, 122, 0.24);
  box-shadow: 0 14px 36px rgba(32, 20, 62, 0.14);
}
html[data-theme="light"] .spinner {
  border-color: rgba(24, 19, 38, 0.1);
  border-top-color: #ef2b7a;
  border-right-color: #ff8a3d;
}
html[data-theme="light"] #tg-toast {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(239, 43, 122, 0.35);
  color: #181326;
  box-shadow: 0 12px 28px rgba(32, 20, 62, 0.15);
}
