/* AtVITE Pages — hub shell + directory workspace.
 *
 * Shares the Games/Polls geometry: sticky 260px sidebar, static h1 +
 * right-aligned actions, rounded panels with kickers, chips, card grids.
 * The 1025–1100px band keeps the desktop sidebar; the off-canvas drawer
 * starts at 1024px so the main panel never loses its column.
 */

/* ------------------------------------------------------------------ theme */
body:has(.pg-app) { background: #f3f7ff !important; }
html.dark body:has(.pg-app) { background: #060912 !important; }
.pg-app {
  --acc: #4f8cff;
  --acc-soft: rgba(79, 140, 255, .14);
  --pg-acc: #4f8cff;
  --pg-acc-2: #8b5cf6;
  --pg-acc-soft: rgba(79, 140, 255, .14);
  --pg-card: #111a2e;
  --pg-card-2: #0c1424;
  --pg-shadow: 0 14px 34px rgba(2, 6, 23, .18);
  background: transparent !important;
}
html.light .pg-app {
  --acc: #1d4ed8;
  --acc-soft: rgba(29, 78, 216, .09);
  --pg-acc: #1d4ed8;
  --pg-acc-2: #7c3aed;
  --pg-acc-soft: rgba(29, 78, 216, .09);
  --pg-card: #ffffff;
  --pg-card-2: #f8fafc;
  --pg-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}
.pg-app .btn.primary {
  background: linear-gradient(135deg, #3f68f5, #5b7cff 55%, #7c5cff);
  border-color: #5b7cff;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(63, 104, 245, .24);
}
.pg-app .btn.primary:hover { filter: brightness(1.05); }
html.light .pg-app .btn.primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #7c3aed);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, .18);
}

/* ------------------------------------------------------------------ shell */
.pg-app { min-width: 0; }
.pg-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; z-index: 50; }
.pg-main { min-width: 0; display: block; padding: 13px 0 0 !important; }
/* Match the Polls studio: capped, centered content with the same 32px gutters
 * so the main panel aligns the same way at every width. */
.pg-content { width: 100%; max-width: 1560px; margin-inline: auto; padding: 24px 32px 48px !important; }
#tabs { display: block !important; }
.pg-nav-sec { color: var(--muted); }
.pg-nav .e-nav-item:hover { text-decoration: none; }

/* Sidebar head + primary action keep the same rhythm as Games/Polls. */
.e-nav-head { border-bottom: 0 !important; padding: 14px 12px !important; }
.e-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.e-brand:hover { color: inherit; text-decoration: none; }
.pg-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--pg-acc); background: linear-gradient(135deg, rgba(79,140,255,.16), rgba(139,92,246,.14));
  border: 1px solid var(--line);
}
.pg-logo svg { width: 18px; height: 18px; display: block; }
.e-mobile-toggle { top: 14px; padding: 1px 6px; }
.e-mobile-toggle svg { width: 21px; height: 29px; }
.e-sidebar { padding-top: 0 !important; }
.e-nav-body { margin: 0 !important; }

.pg-new {
  position: relative; flex: none; display: flex; align-items: center; gap: 9px;
  width: calc(100% - 16px); height: 42px; margin: 9px 8px 6px;
  padding: 0 12px 0 13px; border: 0; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, #3f68f5, #5b7cff 55%, #7c5cff);
  box-shadow: 0 8px 20px rgba(63, 104, 245, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
  font: inherit; font-weight: 650; font-size: 13.5px; letter-spacing: -.01em; cursor: pointer;
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.pg-new svg { width: 17px; height: 17px; flex: none; }
.pg-new span { flex: 1; text-align: left; }
.pg-new kbd {
  padding: 2px 6px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 6px;
  background: rgba(255, 255, 255, .18); color: #fff; font: inherit; font-size: 10px;
}
.pg-new:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(63, 104, 245, .34), inset 0 1px 0 rgba(255, 255, 255, .22); }
.pg-new:active { transform: translateY(1px); }
.e-app.sidebar-collapsed .pg-new { width: 35px; height: 35px; margin: 6px auto 8px; padding: 0; justify-content: center; border-radius: 10px; }
.e-app.sidebar-collapsed .pg-new span, .e-app.sidebar-collapsed .pg-new kbd { display: none; }

.pg-side-search { flex: 0 0 auto; padding: 12px; margin: 0; border: 0; position: relative; z-index: 35; }
.pg-side-search .e-side-search-box {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
}
.pg-side-search .e-side-search-box:focus-within { border-color: var(--pg-acc); box-shadow: 0 0 0 3px var(--pg-acc-soft); }
.pg-side-search .e-side-search-box svg { flex: none; color: var(--muted); }
.pg-side-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--txt);
  font: inherit; font-size: 13px; line-height: 1.55; padding: 0; outline: none;
}
.pg-side-search input::placeholder { color: var(--muted); }
.pg-side-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; padding: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}
.pg-side-suggest button {
  display: block; width: 100%; text-align: left; padding: 8px 9px; border: 0; border-radius: 7px;
  background: transparent; color: var(--txt); font: inherit; font-size: 12px; cursor: pointer;
}
.pg-side-suggest button:hover { background: var(--pg-acc-soft); }
.pg-side-empty { padding: 8px 9px; font-size: 12px; color: var(--muted); }
.e-app.sidebar-collapsed .pg-side-search { display: none; }

@media (min-width: 1025px) {
  .pg-app { grid-template-columns: 260px minmax(0, 1fr) !important; }
  .pg-app.sidebar-collapsed { grid-template-columns: 60px minmax(0, 1fr) !important; }
  .pg-sidebar { background: color-mix(in srgb, var(--panel) 86%, transparent) !important; }
  html.dark .pg-sidebar { background: #0b1324 !important; }
  .e-nav-head { min-height: 64px; padding: 14px 12px !important; border-bottom: 0 !important; }
  .sb-brand-text b { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--txt); }
  .sb-brand-text span { display: block; font-size: 11px; line-height: 1.6; color: var(--muted); white-space: nowrap; }
  .e-desktop-toggle { padding: 1px 6px !important; }
  .e-desktop-toggle svg { width: 21px !important; height: 29px !important; }

  .e-nav-label {
    font-size: 10px !important; font-weight: 800 !important;
    letter-spacing: .12em !important; text-transform: uppercase !important;
    color: var(--muted) !important; padding: 4px 8px !important;
  }
  .e-nav-group { margin-top: 10px; }
  .e-nav-group:first-child { margin-top: 0; }
  .e-nav-body { padding: 10px 8px 14px !important; }

  .pg-nav .e-nav-item {
    width: 100%; height: 39px; min-height: 39px; line-height: 21px; padding: 8px 10px;
    gap: 8px; font-size: 13px; display: flex; align-items: center; text-align: left;
    border-radius: 10px; border: 1px solid transparent; background: transparent;
    color: var(--txt); font-family: inherit; cursor: pointer; box-sizing: border-box; text-decoration: none;
  }
  .pg-nav .e-nav-item:hover { background: var(--panel-2); border-color: var(--line); }
  .pg-nav .e-nav-item.active, .pg-nav .e-nav-item.on {
    background: var(--pg-acc-soft) !important;
    border-color: color-mix(in srgb, var(--pg-acc) 35%, transparent) !important;
    color: var(--pg-acc) !important;
    font-weight: 700;
    box-shadow: none !important;
  }
  .pg-nav .e-nav-icon {
    width: 20px !important; height: 20px !important; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent !important; border-radius: 0 !important; color: var(--muted);
  }
  .pg-nav .e-nav-icon svg { width: 20px; height: 20px; display: block; }
  .pg-nav .e-nav-item.active .e-nav-icon, .pg-nav .e-nav-item.on .e-nav-icon { color: var(--pg-acc) !important; }
  .pg-nav .e-nav-text { flex: 1; min-width: 0; }

  .pg-app.sidebar-collapsed .e-brand { display: none !important; }
  .pg-app.sidebar-collapsed .e-nav-head {
    min-height: 64px; height: auto; padding: 14px 12px !important;
    margin-bottom: 6px; border-bottom-color: transparent !important; justify-content: center;
  }
  .pg-app.sidebar-collapsed .sb-brand-text,
  .pg-app.sidebar-collapsed .e-nav-label,
  .pg-app.sidebar-collapsed .e-nav-text { display: none !important; }
  .pg-app.sidebar-collapsed .e-nav-body {
    display: flex; flex-direction: column; align-items: center;
    padding: 4px 0 14px !important; gap: 5px; scrollbar-width: none;
  }
  .pg-app.sidebar-collapsed .e-nav-body::-webkit-scrollbar { width: 0; display: none; }
  .pg-app.sidebar-collapsed .e-nav-group { width: 100%; margin-top: 0; }
  .pg-app.sidebar-collapsed .pg-nav .e-nav-item {
    width: 35px; height: 35px; min-height: 35px; padding: 0; gap: 0;
    justify-content: center; margin: 0 auto;
  }
  .pg-app.sidebar-collapsed .pg-nav .e-nav-icon { width: 20px !important; height: 20px !important; }
  .pg-app.sidebar-collapsed .e-desktop-toggle svg { transform: scaleX(-1); }
}

/* ------------------------------------------------------------------ head */
.pg-page-head {
  min-height: 38px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 32px; background: transparent; border: 0; box-shadow: none;
  position: static;
}
.pg-page-head h1 {
  margin: 0; color: var(--txt); font-size: 20px; line-height: 1.2;
  font-weight: 750; letter-spacing: -.02em;
}
.pg-page-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; margin-left: auto; justify-content: flex-end; }
.pg-page-actions .btn { min-height: 35px; height: 35px; padding: 0 12px; font-size: 12px; gap: 6px; }

/* ------------------------------------------------------------------ panels */
.pg-page { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pg-panel {
  min-width: 0; padding: clamp(16px, 1.7vw, 22px); border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--pg-card), var(--pg-card-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), var(--pg-shadow);
}
.pg-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 0; margin: 0 0 15px; padding: 0 0 12px; border-bottom: 1px solid var(--line);
}
.pg-kicker {
  display: block; margin: 0; color: var(--pg-acc); font-size: 9px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1.4;
}
.pg-panel-meta {
  flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.pg-gated-panel {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  border-style: dashed; padding: clamp(22px, 3vw, 34px);
}
.pg-gated-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  color: var(--pg-acc); background: var(--pg-acc-soft); border: 1px solid color-mix(in srgb, var(--pg-acc) 24%, transparent);
}
.pg-gated-panel b { font-size: 16px; letter-spacing: -.01em; }
.pg-gated-panel p { margin: 0; max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.pg-more-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* ------------------------------------------------------------------ toolbar */
.pg-toolbar-panel { display: flex; flex-direction: column; gap: 0; }
.pg-controls-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pg-controls-row .pg-search { flex: 1 1 260px; min-width: 0; }
.pg-controls-row .pg-selects { flex: 0 0 auto; }
.pg-search {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px;
  padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
  transition: border-color .15s, box-shadow .15s;
}
.pg-search:focus-within { border-color: var(--pg-acc); box-shadow: 0 0 0 3px var(--pg-acc-soft); }
.pg-search svg { flex: none; color: var(--muted); }
.pg-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--txt);
  font: inherit; font-size: 13px; line-height: 1.5; padding: 0; outline: none;
}
.pg-search input::placeholder { color: var(--muted); }
.pg-filter-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 12px;
}
.pg-typebar { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; width: 100%; }
.pg-chip {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 33px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2);
  color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  cursor: pointer; transition: color .14s, border-color .14s, background .14s, opacity .14s; width: 100%;
}
.pg-chip:hover { color: var(--txt); border-color: var(--line-2, var(--line)); }
.pg-chip.on {
  background: var(--pg-acc-soft); border-color: color-mix(in srgb, var(--pg-acc) 42%, transparent);
  color: var(--pg-acc);
}
.pg-chip.is-empty { opacity: .62; }
.pg-chip-count {
  font-size: 9.5px; font-weight: 700; opacity: .72; padding: 1px 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--txt) 7%, transparent);
}
.pg-selects { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.pg-select {
  min-height: 38px; max-width: 220px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; outline: none;
}
.pg-select:focus { border-color: var(--pg-acc); box-shadow: 0 0 0 3px var(--pg-acc-soft); }

/* ------------------------------------------------------------------ cards */
.pg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px; align-items: stretch;
}
.pg-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, var(--pg-card), var(--pg-card-2));
  box-shadow: 0 8px 22px rgba(2, 6, 23, .1);
  transition: transform .16s, border-color .16s, box-shadow .16s, opacity .16s;
}
.pg-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--pg-acc) 38%, var(--line));
  box-shadow: 0 18px 36px rgba(2, 6, 23, .18);
}
.pg-card.is-removing { opacity: 0; transform: translateY(-4px); }
html.light .pg-card { box-shadow: 0 8px 20px rgba(15, 23, 42, .06); }
html.light .pg-card:hover { box-shadow: 0 16px 32px rgba(15, 23, 42, .1); }

.pg-card-cover {
  position: relative; height: 104px; flex: none; overflow: hidden;
  background:
    radial-gradient(140% 120% at 12% -10%, rgba(255,255,255,.24), transparent 48%),
    linear-gradient(135deg, var(--pg-cover-a, #3f68f5), var(--pg-cover-b, #7c5cff));
}
.pg-card-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(2,6,23,0) 35%, rgba(2,6,23,.38));
  pointer-events: none;
}
.pg-card-cover > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .92;
}
.pg-type-pill, .pg-cover-stat {
  position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  min-height: 22px; padding: 0 8px; border-radius: 999px;
  background: rgba(3, 7, 18, .58); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; backdrop-filter: blur(6px);
}
.pg-type-pill { top: 10px; left: 10px; }
.pg-cover-stat { right: 10px; bottom: 10px; text-transform: none; letter-spacing: 0; font-size: 10px; }
.pg-cover-stat svg { width: 13px; height: 13px; }

.pg-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; padding: 13px 14px 14px; }
.pg-card-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pg-avatar {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 13px; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
  background: linear-gradient(135deg, #3f68f5, #8b5cf6);
  border: 1px solid rgba(255, 255, 255, .16);
}
.pg-avatar > span { position: relative; z-index: 0; }
.pg-avatar > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.pg-avatar-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 11px; }
.pg-card-title { flex: 1; min-width: 0; padding-top: 1px; }
.pg-card-title b {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  color: var(--txt); font-size: 14.5px; line-height: 1.3; font-weight: 750; letter-spacing: -.01em;
}
.pg-card-title small {
  display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11px; line-height: 1.35;
}
.pg-verified {
  display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%;
  color: #fff; background: var(--pg-acc);
}
.pg-verified svg { width: 10px; height: 10px; stroke-width: 2.6; }
.pg-card-desc {
  margin: 0; min-height: 34px; color: var(--muted); font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pg-card-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
}
.pg-co-card .pg-card-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-card-stat { min-width: 0; }
.pg-card-stat b {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--txt); font-size: 13px; line-height: 1.2; font-weight: 750;
}
.pg-card-stat small {
  display: block; margin-top: 1px; color: var(--muted); font-size: 9px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.pg-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.pg-card-note, .pg-role {
  flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.pg-card-note { color: var(--muted); }
.pg-role {
  padding: 2px 6px; border-radius: 999px; color: var(--pg-acc);
  background: var(--pg-acc-soft); border: 1px solid color-mix(in srgb, var(--pg-acc) 24%, transparent);
}
.pg-card-actions { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pg-open {
  display: inline-flex; align-items: center; gap: 4px; color: var(--pg-acc);
  font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap;
}
.pg-open:hover { text-decoration: underline; }
.pg-open svg { transition: transform .14s; }
.pg-open:hover svg { transform: translateX(2px); }
.pg-follow {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 10px;
  border: 1px solid var(--line-2, var(--line)); border-radius: 999px; background: transparent;
  color: var(--txt); font: inherit; font-size: 10.5px; font-weight: 750; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.pg-follow:hover { border-color: var(--pg-acc); color: var(--pg-acc); }
.pg-follow.on { background: var(--pg-acc-soft); border-color: color-mix(in srgb, var(--pg-acc) 38%, transparent); color: var(--pg-acc); }
.pg-follow:disabled { opacity: .55; cursor: wait; }

/* Company cards have no cover: brand mark leads the card. */
.pg-co-card { padding: 15px; gap: 10px; }
.pg-co-head { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.pg-co-logo {
  position: relative; flex: none; width: 52px; height: 52px; border-radius: 15px; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 800;
  background: linear-gradient(135deg, #0ea5e9, #4f46e5 65%, #7c3aed);
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 8px 18px rgba(14, 165, 233, .18);
}
.pg-co-logo > span { position: relative; z-index: 0; }
.pg-co-logo > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.pg-co-card .pg-card-title { padding-top: 3px; }
.pg-co-card .pg-card-desc { min-height: 18px; -webkit-line-clamp: 2; }
.pg-co-card .pg-card-foot { margin-top: auto; padding-top: 2px; }

/* ------------------------------------------------------------------ empty + skeleton */
.pg-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 38px 18px; text-align: center;
  border: 1px dashed color-mix(in srgb, var(--pg-acc) 26%, var(--line)); border-radius: 16px;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}
.pg-empty-icon {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 3px;
  border-radius: 50%; color: var(--pg-acc); background: var(--pg-acc-soft);
  border: 1px solid color-mix(in srgb, var(--pg-acc) 22%, transparent);
}
.pg-empty b { color: var(--txt); font-size: 14px; font-weight: 750; }
.pg-empty > span:not(.pg-empty-icon) { max-width: 460px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.pg-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 9px; }
.pg-skel {
  min-height: 244px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--panel-2) 0%, color-mix(in srgb, var(--panel-2) 55%, var(--panel)) 50%, var(--panel-2) 100%);
  background-size: 220% 100%; animation: pgShimmer 1.25s ease-in-out infinite;
}
@keyframes pgShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.pg-more { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 15px; min-height: 40px; }
.pg-more .btn { min-height: 35px; height: 35px; padding: 0 14px; font-size: 12px; }
.pg-more-sentinel { width: 100%; height: 1px; }

/* ------------------------------------------------------------------ stats */
.pg-stats { display: grid; gap: 8px; }
.pg-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pg-stat {
  min-width: 0; padding: 12px 13px; border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), color-mix(in srgb, var(--panel-2) 70%, transparent));
}
.pg-stat b { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--txt); font-size: 20px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.pg-stat span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

/* ------------------------------------------------------------------ trend lists */
.pg-trend-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; min-width: 0; }
.pg-trend-split > .pg-panel { min-width: 0; }
.pg-trend-split .pg-empty { padding: 28px 16px; }
.pg-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pg-rank-row {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 9px;
  border: 1px solid transparent; border-radius: 11px; color: inherit; text-decoration: none;
  transition: background .14s, border-color .14s;
}
.pg-rank-row:hover { background: var(--panel-2); border-color: var(--line); text-decoration: none; }
.pg-rank-num { flex: none; width: 21px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .03em; }
.pg-rank-body { flex: 1; min-width: 0; }
.pg-rank-body b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; line-height: 1.35; font-weight: 700; }
.pg-rank-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10.5px; }
.pg-rank-metric { flex: none; min-width: 54px; text-align: right; }
.pg-rank-metric b { display: block; color: var(--txt); font-size: 12px; line-height: 1.3; font-weight: 800; }
.pg-rank-metric small { display: block; color: var(--muted); font-size: 9.5px; }

/* ------------------------------------------------------------------ type + category cards */
.pg-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pg-type-card {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 13px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2);
  color: var(--txt); font: inherit; text-align: left; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s, opacity .15s;
}
.pg-type-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--pg-acc) 40%, var(--line)); background: color-mix(in srgb, var(--pg-acc-soft) 45%, var(--panel-2)); }
.pg-type-card.is-empty { opacity: .64; }
.pg-type-icon {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: var(--pg-acc); background: var(--pg-acc-soft);
  border: 1px solid color-mix(in srgb, var(--pg-acc) 18%, transparent);
}
.pg-type-body { flex: 1; min-width: 0; }
.pg-type-body b { display: block; font-size: 13px; line-height: 1.35; font-weight: 750; }
.pg-type-body small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.pg-type-count { flex: none; color: var(--pg-acc); font-size: 12px; font-weight: 800; }
.pg-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pg-cat-card {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 38px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2);
  color: var(--txt); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
  transition: border-color .14s, color .14s, background .14s, opacity .14s; width: 100%;
}
.pg-cat-card:hover { border-color: var(--pg-acc); color: var(--pg-acc); }
.pg-cat-card.is-empty { opacity: .64; }
.pg-cat-card span {
  padding: 1px 6px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--txt) 7%, transparent);
  font-size: 9.5px; font-weight: 800;
}

/* ------------------------------------------------------------------ bars */
.pg-bars { display: flex; flex-direction: column; gap: 9px; }
.pg-bar-row { display: grid; grid-template-columns: minmax(80px, 130px) minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.pg-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); font-size: 11.5px; font-weight: 650; }
.pg-bar-row b { text-align: right; color: var(--txt); font-size: 11px; font-weight: 800; }
.pg-bar { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pg-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pg-acc), var(--pg-acc-2)); transition: width .4s ease; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1024px) {
  .pg-app, .pg-app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr) !important; }
  .pg-app .pg-main { padding: 9px 0 0 !important; }
  .pg-page-head { padding: 0 14px 0 44px; }
  .pg-page-head h1 { font-size: 18px; margin-left: 10px; }
  .pg-content { padding: 14px 14px 32px !important; }
  .pg-sidebar {
    position: fixed !important; left: 0 !important; top: 0 !important; bottom: 0 !important;
    height: 100dvh !important; width: min(86vw, 300px) !important;
    transform: translateX(-105%); transition: transform .18s ease; z-index: 50;
  }
  .pg-app.nav-open .pg-sidebar { transform: translateX(0); }
  #eDesktopToggle { display: none !important; }
  #eNavToggle { display: inline-flex !important; top: 10px; left: 12px; width: 35px; height: 35px; z-index: 60; }
  #eBackdrop { z-index: 45; }
  .pg-app.sidebar-collapsed .e-brand { display: inline-flex !important; }
  .pg-app.sidebar-collapsed .sb-brand-mark { display: grid !important; }
  .pg-app.sidebar-collapsed .pg-side-search { display: block !important; }
  .pg-app.sidebar-collapsed .e-nav-text, .pg-app.sidebar-collapsed .e-nav-label { display: block !important; }
  .pg-app.sidebar-collapsed .e-nav-body { padding: 10px 8px 14px !important; }
}

@media (max-width: 900px) {
  .pg-trend-split { grid-template-columns: minmax(0, 1fr); }
  .pg-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 760px) {
  .pg-stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pg-card-cover { height: 88px; }
  .pg-card-body { padding: 11px 12px 12px; }
  .pg-card-title b { font-size: 13.5px; }
  .pg-card-desc { font-size: 11.5px; min-height: 32px; }
  .pg-card-foot { flex-wrap: wrap; }
  .pg-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .pg-page-head { flex-wrap: wrap; row-gap: 7px; }
  .pg-page-head h1 { font-size: 16px; }
  .pg-page-actions .btn { height: 33px; min-height: 33px; padding: 0 10px; font-size: 11px; }
  .pg-controls-row { flex-wrap: nowrap; gap: 8px; }
  .pg-controls-row .pg-search { flex: 1 1 0; min-width: 0; }
  .pg-controls-row .pg-selects { flex: 0 1 auto; width: auto; flex-wrap: nowrap; gap: 6px; }
  .pg-controls-row .pg-select { flex: 0 1 140px; min-width: 0; max-width: 160px; padding: 0 8px; font-size: 11px; }
  .pg-filter-row { flex-direction: column; }
  .pg-typebar { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .pg-panel { border-radius: 16px; }
  .pg-panel-meta { max-width: 48%; font-size: 10px; }
  .pg-stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-card-stats { gap: 4px; }
  .pg-rank-metric { min-width: 44px; }
  .pg-bar-row { grid-template-columns: minmax(70px, 104px) minmax(0, 1fr) 32px; gap: 8px; }
  .pg-empty { padding: 30px 14px; }
}

@media (max-width: 520px) {
  .pg-grid { grid-template-columns: minmax(0, 1fr); }
  .pg-card-cover { height: 106px; }
  .pg-card-desc { min-height: 0; }
  .pg-stats-3, .pg-stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-type-grid { grid-template-columns: minmax(0, 1fr); }
  .pg-card-actions { margin-left: auto; }
}

@media (max-width: 380px) {
  .pg-content { padding-left: 10px !important; padding-right: 10px !important; }
  .pg-page-head { padding-right: 10px; }
  .pg-controls-row .pg-selects { flex-direction: row; }
  .pg-controls-row .pg-select { width: auto; flex: 0 1 120px; }
}

/* Desktop sidebar stays put across the 1100px line; the drawer begins at 1024. */
@media (min-width: 1025px) and (max-width: 1100px) {
  .pg-app { grid-template-columns: 260px minmax(0, 1fr) !important; }
  .pg-app.sidebar-collapsed { grid-template-columns: 60px minmax(0, 1fr) !important; }
  .pg-app .pg-sidebar {
    position: sticky !important; left: auto !important; top: 0 !important;
    bottom: auto !important; height: 100vh !important; height: 100dvh !important;
    width: 260px !important; transform: none !important; z-index: 20 !important;
  }
  .pg-app.sidebar-collapsed .pg-sidebar {
    width: 60px !important;
  }
  #eDesktopToggle { display: inline-flex !important; }
  #eNavToggle { display: none !important; }
}
