/* =========================================================================
   GroupHub — WhatsApp Group Directory
   ========================================================================= */
:root {
  --wa-green: #25d366;
  --wa-dark: #075e54;
  --wa-teal: #128c7e;
  --bg: #f1f4f8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6a7686;
  --border: #e4e9f0;
  --shadow: 0 2px 8px rgba(20, 40, 80, .06);
  --shadow-lg: 0 12px 32px rgba(20, 40, 80, .12);
  --shadow-soft: 0 8px 28px rgba(15, 35, 60, .07);
  --shadow-card: 0 4px 20px rgba(15, 35, 60, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --danger: #e03b3b;
  --warn: #d9870b;
  --ok: #1c9e54;
  --info: #2563c9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wa-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.page { width: 100%; max-width: 100%; padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--wa-dark), var(--wa-teal));
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: min(210px, 70vw);
}
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.main-nav a { color: #eafff5; font-weight: 500; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 4px; padding: 8px; margin-left: auto; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: .15s; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--wa-green); color: #053b34; }
.btn-primary:hover { background: #1ec25c; }
.join-countdown-btn.is-waiting {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}
.join-countdown-btn:not(.is-waiting) {
  animation: join-ready 0.35s ease;
}
@keyframes join-ready {
  from { transform: scale(0.97); }
  to   { transform: scale(1); }
}

/* ---------- Join prepare overlay (inside group card) ---------- */
.group-card { position: relative; overflow: hidden; }
.join-prepare-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: none; place-items: center;
  background: rgba(255, 255, 255, .97);
  border-radius: inherit;
  padding: 12px;
}
.group-card.is-preparing .join-prepare-overlay,
.group-card.is-ready .join-prepare-overlay {
  display: grid;
}
.join-prepare-inner {
  text-align: center;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.join-prepare-wait { width: 100%; }
.group-card.is-ready .join-prepare-wait { display: none; }
.join-prepare-ready {
  display: none;
  width: 100%;
  padding: 4px 2px;
}
.group-card.is-ready .join-prepare-ready { display: block; }
.join-prepare-go-btn {
  display: block;
  width: 100%;
  padding: 14px 12px;
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: clamp(.82rem, 3.2vw, .95rem);
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
  border: none;
  box-shadow:
    0 0 0 1px rgba(229, 57, 53, .45),
    0 -3px 12px rgba(255, 59, 59, .55),
    0  3px 12px rgba(255, 59, 59, .55),
    0 8px 24px rgba(0, 0, 0, .18);
  transition: transform .15s, box-shadow .15s;
}
.join-prepare-go-btn:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(229, 57, 53, .6),
    0 -4px 16px rgba(255, 59, 59, .65),
    0  4px 16px rgba(255, 59, 59, .65),
    0 10px 28px rgba(0, 0, 0, .22);
}
.join-prepare-clock {
  width: min(42%, 100px);
  aspect-ratio: 1;
  margin: 0 auto 10px;
  flex-shrink: 0;
}
.join-prepare-arc {
  stroke-dasharray: 276.46;
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset .9s linear;
}
.join-prepare-count {
  margin: 0 0 6px; line-height: 1;
  font-weight: 800; letter-spacing: -.02em;
}
.join-prepare-n {
  font-size: clamp(1.8rem, 8vw, 2.6rem); color: #e53935;
}
.join-prepare-unit {
  font-size: clamp(1.2rem, 5vw, 1.75rem); color: #2b3440; margin-left: 3px;
}
.join-prepare-msg {
  margin: 0; color: #8a97a5; font-size: clamp(.82rem, 3.5vw, .95rem);
}
.btn-dark { background: var(--wa-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f6f9fc; }
.btn-danger { background: #fdecec; color: var(--danger); border-color: #f6caca; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .92rem; border: 1px solid; }
.alert-success { background: #e7f8ee; color: #0f6b38; border-color: #bce6cd; }
.alert-error { background: #fdecec; color: #a81f1f; border-color: #f3c6c6; }
.alert-warning { background: #fdf4e3; color: #8a5a09; border-color: #f0dcaf; }
.alert-info { background: #e8f0fd; color: #1b4ba0; border-color: #c5d8f6; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--wa-dark), var(--wa-teal));
  color: #fff; border-radius: var(--radius); padding: 38px 26px; margin-bottom: 26px;
  text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 1.9rem; }
.hero p { margin: 0 0 18px; opacity: .92; }
.hero .search-form { display: flex; gap: 8px; max-width: 540px; margin: 0 auto; }
.hero .search-form input {
  flex: 1; border: 0; border-radius: var(--radius-sm); padding: 13px 16px; font-size: 1rem;
}
.hero-stats { display: flex; gap: 26px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.hero-stats b { font-size: 1.3rem; display: block; }
.hero-stats span { opacity: .85; font-size: .85rem; }

/* ---------- Section ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; gap: 12px; flex-wrap: wrap; }
.section-head h2 {
  margin: 0;
  font-size: 1.3rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; background: #fff; font-size: .9rem;
}

/* ---------- Category cards (Linky.pk — image + caption) ---------- */
.category-section {
  margin: 0 0 32px;
  width: 100%;
  max-width: 100%;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 14px;
  width: 100%;
  max-width: 100%;
}
.category-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.category-tile.is-active .category-card-img {
  outline: 3px solid var(--wa-green);
  outline-offset: 2px;
}
.category-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 92px;
  aspect-ratio: 2 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
  transition: transform .18s, box-shadow .18s;
  text-decoration: none;
}
@supports not (aspect-ratio: 2 / 1) {
  .category-card-img { height: 92px; }
}
.category-card-img:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
}
.category-card-img.has-photo {
  background: #fff;
}
.category-card-img.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.category-card-emoji {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .22));
}
.category-card-caption {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: clamp(.72rem, 1.1vw, .88rem);
  line-height: 1.25;
  text-decoration: none;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.category-card-caption:hover { text-decoration: none; }
.caption-red { color: #e53935; }
.caption-green { color: #2e7d32; }

@media (max-width: 992px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .category-card-caption { font-size: .7rem; }
}

/* ---------- Category article (SEO landing content) ---------- */
.category-article {
  margin: 0 0 36px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}
.category-article-inner { padding-bottom: 8px; }
.category-article p {
  margin: 0;
  padding: 14px 22px;
  line-height: 1.7;
  color: var(--text);
}
.category-article .article-heading {
  margin: 0;
  padding: 14px 18px;
  background: #1b9e3e;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.12rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.category-article .article-list {
  margin: 0;
  padding: 10px 22px 10px 40px;
  line-height: 1.7;
}
.category-article .article-list li { margin: 8px 0; }

/* ---------- Category landing page ---------- */
.category-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.category-page-header {
  margin: 0 0 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
  width: 100%;
}
.category-page-header-compact { margin-bottom: 16px; }
.category-page-title {
  margin: 0;
  padding: 16px 18px;
  background: #1b9e3e;
  color: #fff;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.category-page-desc {
  margin: 0;
  padding: 16px 22px;
  background: #fff;
  line-height: 1.7;
  color: var(--text);
  text-align: center;
  overflow-wrap: anywhere;
}
.category-page-cover {
  margin: 0 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .08);
  width: 100%;
  max-width: 100%;
}
.category-page-cover img {
  width: 100%;
  height: auto;
  max-height: 280px;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  display: block;
}
.category-page-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 280px;
  aspect-ratio: 3 / 1;
}
.category-page-cover-emoji {
  font-size: clamp(3rem, 10vw, 4.5rem);
  line-height: 1;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, .25));
}

/* ---------- Channel strip (Linky-style) ---------- */
.channels-section { margin: 0 0 34px; }
.channel-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
}
.channel-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px 14px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  transition: transform .18s, box-shadow .18s;
}
.channel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.channel-card-avatar {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #eef2f7;
  margin: 0 auto 14px;
  display: block;
  flex-shrink: 0;
}
.channel-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.channel-card-title {
  margin: 0 0 16px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
  width: 100%;
  min-width: 0;
}
.channel-card-title a {
  color: #1a2332;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.channel-card-title a:hover { color: var(--wa-teal); }
.btn-channel-join {
  width: 100%;
  margin-top: auto;
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 12px;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn-channel-join:hover {
  background: #d32f2f;
  transform: translateY(-1px);
  text-decoration: none;
}
.channel-card .join-prepare-overlay { border-radius: var(--radius); }
.channel-card .join-prepare-inner { padding: 8px; }
.channel-card .join-prepare-clock { max-width: 96px; margin: 0 auto; }
@media (max-width: 960px) {
  .channel-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 640px) {
  .channel-strip { gap: 14px; }
  .channel-card { padding: 22px 12px 16px; }
  .channel-card-avatar { width: 124px; height: 124px; }
  .channel-card-title { font-size: .95rem; }
}

/* ---------- Category chips (legacy) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: .85rem; color: var(--text); font-weight: 500;
}
.chip:hover, .chip.active { background: var(--wa-dark); color: #fff; border-color: var(--wa-dark); text-decoration: none; }

/* ---------- Grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: .18s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-media { position: relative; display: block; aspect-ratio: 16/10; min-height: 140px; background: #dfe6ee; }
@supports not (aspect-ratio: 16 / 10) {
  .card-media { height: 170px; }
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 10px; font-size: .72rem; font-weight: 700; padding: 4px 9px;
  border-radius: 999px; backdrop-filter: blur(4px);
}
.badge-featured { left: 10px; background: rgba(255,193,7,.95); color: #4a3500; }
.badge-category { right: 10px; background: rgba(7,94,84,.9); color: #fff; }
.badge-channel { right: 10px; background: rgba(37,99,201,.92); color: #fff; }
.card-body { padding: 14px 15px 6px; flex: 1; }
.card-title { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.3; min-width: 0; }
.card-title a {
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verified { color: var(--wa-green); font-size: .85rem; }
.card-desc { margin: 0 0 10px; color: var(--muted); font-size: .88rem; }
.card-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.card-meta .dot { opacity: .5; }
.card-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px 12px;
}
.card-actions .btn {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 7px 8px;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.card-actions .btn-primary { font-weight: 700; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; text-align: center; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text); font-weight: 600;
}
.pagination .current { background: var(--wa-dark); color: #fff; border-color: var(--wa-dark); }
.pagination a:hover { background: #f0f4f8; text-decoration: none; }

/* ---------- Forms ---------- */
.form-wrap { max-width: 680px; margin: 0 auto; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel h1, .panel h2 { margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=url],
.field input[type=password], .field input[type=tel], .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: .95rem; font-family: inherit; background: #fff;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--wa-teal); box-shadow: 0 0 0 3px rgba(18,140,126,.12);
}
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Detection preview ---------- */
.detect-box {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px;
  margin-bottom: 16px; background: #f8fbfd;
}
.detect-box.is-loading { opacity: .7; }
.detect-status { font-size: .85rem; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.detect-status .dot-ind { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.detect-status.ok .dot-ind { background: var(--ok); }
.detect-status.bad .dot-ind { background: var(--danger); }
.detect-status.warn .dot-ind { background: var(--warn); }
.detect-preview { display: flex; gap: 14px; align-items: flex-start; }
.detect-preview img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.detect-preview .meta strong { display: block; }
.detect-preview .meta p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--wa-teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Single group page ---------- */
.group-hero { display: grid; grid-template-columns: 160px 1fr; gap: 22px; align-items: center; }
.group-hero img { width: 160px; height: 160px; border-radius: 18px; object-fit: cover; border: 1px solid var(--border); }
.group-hero h1 { margin: 0 0 8px; font-size: 1.7rem; }
.group-display-title {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 3.8vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--text);
}
.group-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { background: #eef3f7; color: var(--muted); border-radius: 999px; padding: 4px 11px; font-size: .8rem; font-weight: 600; }
.tag.green { background: #e7f8ee; color: var(--ok); }
.group-stats-row { display: flex; gap: 22px; margin: 14px 0; color: var(--muted); font-size: .9rem; }
.group-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.prose { line-height: 1.7; }
.prose p { margin: 0 0 12px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(10,20,30,.5); display: none; place-items: center; z-index: 100; padding: 16px; }
.modal.open { display: grid; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 22px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); }
.modal-box h3 { margin-top: 0; }
.modal-close { float: right; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }

/* ---------- Admin ---------- */
body.admin-page {
  overflow-x: hidden;
  max-width: 100%;
}

.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; width: 100%; max-width: 100%; }
.admin-side { background: #0f1b22; color: #c8d4dc; padding: 18px 14px; min-width: 0; }
.admin-side .brand { color: #fff; margin-bottom: 22px; }
.admin-side .brand-logo { height: 30px; max-width: 190px; }
.admin-side nav { display: flex; flex-direction: column; gap: 3px; }
.admin-side nav a { color: #aebcc6; padding: 10px 12px; border-radius: 9px; font-size: .92rem; font-weight: 500; }
.admin-side nav a:hover, .admin-side nav a.active { background: #1b2c36; color: #fff; text-decoration: none; }
.admin-side .side-foot { margin-top: 22px; border-top: 1px solid #233640; padding-top: 14px; font-size: .82rem; }
.admin-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #2a3d48;
  border-radius: 9px;
  background: #1b2c36;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-nav-toggle:hover { background: #243945; }
.admin-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 150;
  border: 0;
  padding: 0;
  margin: 0;
}
body.admin-nav-open .admin-nav-backdrop { display: block; }
.admin-main { padding: 26px; background: var(--bg); min-width: 0; max-width: 100%; box-sizing: border-box; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.admin-topbar h1 { margin: 0; font-size: 1.4rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat b { font-size: 1.6rem; display: block; }
.stat span { color: var(--muted); font-size: .82rem; }

.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-main table.data td.cell-group { white-space: normal; min-width: 180px; max-width: 320px; vertical-align: middle; }
.admin-main table.data td.cell-wrap { white-space: normal; min-width: 120px; }
.admin-main table.data td.cell-details { white-space: normal; min-width: 160px; max-width: 360px; }
table.data th { background: #f6f9fc; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data tr:hover td { background: #fafcfe; }
table.data img.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.cell-actions { display: flex; gap: 6px; }
.btn-wa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 5px 8px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-sched .lbl-short { display: none; }
.btn-act-mobile .lbl-short { display: none; }
.group-row-title { display: block; }
.group-row-title .thumb-in-title { display: none; }

.pill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.pill-pending { background: #fdf4e3; color: #8a5a09; }
.pill-approved { background: #e7f8ee; color: #0f6b38; }
.pill-rejected { background: #fdecec; color: #a81f1f; }
.pill-expired { background: #eef0f2; color: #5a6573; }
.pill-invalid { background: #f3e8fd; color: #6b2f9e; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--wa-dark), var(--wa-teal)); padding: 20px; }
.login-card { background: #fff; border-radius: var(--radius); padding: 30px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card h1 { margin-top: 0; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: #0f1b22; color: #aebcc6; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 28px 16px; flex-wrap: wrap; }
.footer-brand strong { color: #fff; font-size: 1.1rem; }
.footer-brand p { margin: 4px 0 0; font-size: .88rem; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: #aebcc6; }
.footer-bottom { border-top: 1px solid #233640; padding: 14px 16px; font-size: .82rem; }

/* ---------- Responsive ---------- */
@media (min-width: 992px) {
  .container {
    max-width: 1200px;
    padding-left: 20px;
    padding-right: 20px;
  }

  body {
    background: linear-gradient(180deg, #eef3f8 0%, #f6f8fb 42%, #f1f4f8 100%);
  }

  .page { padding-top: 32px; }

  .hero {
    border: none;
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
  }

  .section-head { margin: 32px 0 18px; }
  .section-head h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a2836;
  }
  .section-head .hint { font-weight: 500; color: #8a97a8; }

  .toolbar select {
    border: none;
    background: #fff;
    box-shadow: var(--shadow-card);
    border-radius: 999px;
    padding: 9px 16px;
  }

  .category-grid { gap: 24px 20px; }
  .category-card-img {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
  }
  .category-card-img:hover {
    box-shadow: 0 14px 36px rgba(15, 35, 60, .12);
  }
  .category-tile.is-active .category-card-img {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .45), var(--shadow-soft);
  }

  .category-page-header {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
  }
  .category-page-title {
    padding: 20px 24px;
    background: linear-gradient(135deg, #22b356 0%, #1a9a47 100%);
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .category-page-desc {
    padding: 18px 28px 22px;
    color: #4a5868;
    font-size: 1.02rem;
  }
  .category-page-cover {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 32px;
  }
  .category-page-cover img { max-height: 300px; }

  .category-article {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-top: 8px;
  }
  .category-article p {
    padding: 16px 32px;
    color: #3d4d5c;
    font-size: 1.02rem;
  }
  .category-article .article-heading {
    padding: 16px 24px;
    background: linear-gradient(135deg, #22b356 0%, #1a9a47 100%);
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .category-article .article-list {
    padding: 12px 32px 12px 44px;
    color: #3d4d5c;
  }

  .category-page .grid,
  .page > .grid:not(.category-grid) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
  }

  .channel-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
  }
  .channel-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px 16px 22px;
  }
  .channel-card:hover {
    box-shadow: 0 16px 40px rgba(15, 35, 60, .11);
  }
  .channel-card-avatar {
    width: 200px;
    height: 200px;
    border: 3px solid #f0f3f8;
  }
  .channel-card-title {
    font-size: 1.08rem;
    margin-bottom: 18px;
  }
  .btn-channel-join {
    font-size: .96rem;
    padding: 13px 14px;
  }

  .card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
  }
  .card:hover {
    box-shadow: 0 16px 40px rgba(15, 35, 60, .11);
    transform: translateY(-4px);
  }
  .card-body { padding: 16px 18px 8px; }
  .card-actions { padding: 10px 14px 14px; }

  .pagination a,
  .pagination span {
    border: none;
    background: #fff;
    box-shadow: var(--shadow-card);
    border-radius: 999px;
  }
  .pagination .current {
    background: linear-gradient(135deg, var(--wa-dark), var(--wa-teal));
    box-shadow: 0 4px 14px rgba(7, 94, 84, .25);
  }
  .pagination a:hover {
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 35, 60, .1);
  }

  .empty {
    background: #fff;
    border: none;
    box-shadow: var(--shadow-card);
    border-radius: var(--radius-lg);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 991px) {
  .admin-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
  }

  .admin-side {
    position: sticky;
    top: 0;
    z-index: 160;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  .admin-side .brand { margin-bottom: 0; flex: 1; min-width: 0; }
  .admin-side .brand-logo { max-width: min(190px, 55vw); height: 28px; }
  .admin-nav-toggle { display: inline-flex !important; flex-shrink: 0; }

  /* Hide sidebar links until Menu — drawer on open */
  .admin-side #adminNav {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 88vw);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 64px 10px 88px;
    background: #0f1b22;
    z-index: 200;
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    box-shadow: 4px 0 28px rgba(0, 0, 0, .4);
    -webkit-overflow-scrolling: touch;
  }

  body.admin-nav-open .admin-side #adminNav {
    display: flex !important;
  }

  .admin-side #adminNav a {
    white-space: normal;
    font-size: .88rem;
    padding: 11px 12px;
    flex-shrink: 0;
  }

  .admin-side .side-foot {
    display: none !important;
    position: fixed;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    margin: 0;
    padding: 12px;
    background: #0f1b22;
    border-top: 1px solid #233640;
    z-index: 201;
    box-sizing: border-box;
  }

  body.admin-nav-open .admin-side .side-foot {
    display: block !important;
  }

  .admin-main {
    width: 100%;
    max-width: 100%;
    padding: 12px 10px 28px;
    overflow-x: hidden;
  }

  .admin-topbar {
    margin-bottom: 14px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-topbar h1,
  .admin-topbar h2 {
    font-size: 1.12rem;
    line-height: 1.25;
    margin: 0;
  }

  .admin-topbar .btn,
  .admin-topbar .toolbar,
  .admin-topbar form {
    width: 100%;
    max-width: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat { padding: 12px 14px; }
  .stat b { font-size: 1.35rem; }

  .panel {
    padding: 14px 12px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .filter-bar .field {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    box-sizing: border-box;
  }

  .row2 { grid-template-columns: 1fr !important; }

  /* Admin tables — fit screen, no horizontal scroll */
  .admin-main .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
  }

  .admin-main .table-wrap table.data {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
  }

  .admin-main .table-wrap table.data th,
  .admin-main .table-wrap table.data td {
    padding: 5px 4px;
    font-size: .68rem;
    line-height: 1.25;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
    word-break: normal;
    overflow-wrap: normal;
  }

  .admin-main .table-wrap table.data th {
    font-size: .58rem;
    letter-spacing: 0;
    padding: 5px 3px;
  }

  .admin-main .table-wrap table.data td.cell-group,
  .admin-main .table-wrap table.data td.cell-wrap,
  .admin-main .table-wrap table.data td.cell-details,
  .admin-main .table-wrap table.data td.cell-import {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: none;
  }

  .admin-main .table-wrap table.data td > div {
    min-width: 0 !important;
    max-width: 100%;
  }

  .admin-main .table-wrap table.data select,
  .admin-main .table-wrap table.data input[type="text"],
  .admin-main .table-wrap table.data input[type="search"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .admin-main .table-wrap table.data td.cell-group .hint {
    display: none;
  }

  .admin-main .table-wrap table.data td.cell-group strong {
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .admin-main .table-wrap table.data td.cell-group > div {
    gap: 5px !important;
    min-width: 0 !important;
  }

  .admin-main .table-wrap table.data td.cell-group img,
  .admin-main .table-wrap table.data img.thumb {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
  }

  .admin-main .table-wrap table.data .pill {
    font-size: .56rem;
    padding: 2px 5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
  }

  .admin-main .table-wrap table.data .btn-sm {
    font-size: .6rem;
    padding: 4px 6px;
    line-height: 1.1;
    max-width: 100%;
    box-sizing: border-box;
  }

  .admin-main .table-wrap table.data td.cell-import .btn {
    width: 100%;
    padding: 5px 3px;
    font-size: .52rem;
  }

  .admin-main .table-wrap table.data .cell-actions {
    flex-wrap: wrap;
    gap: 3px;
    white-space: normal;
    min-width: 0;
  }

  .admin-main .table-wrap table.data .cell-actions .btn-sm {
    font-size: .56rem;
    padding: 3px 5px;
  }

  /* Import: checkbox | group | category | import */
  .admin-main table.data.tbl-import th:nth-child(1),
  .admin-main table.data.tbl-import td:nth-child(1) { width: 24px; padding-left: 3px; padding-right: 2px; }
  .admin-main table.data.tbl-import th:nth-child(3),
  .admin-main table.data.tbl-import td:nth-child(3) { width: 17%; }
  .admin-main table.data.tbl-import th:nth-child(7),
  .admin-main table.data.tbl-import td:nth-child(7) { width: 11%; min-width: 0; text-align: center; white-space: normal; padding: 4px 2px; }
  .admin-main table.data.tbl-import th:nth-child(4),
  .admin-main table.data.tbl-import td:nth-child(4),
  .admin-main table.data.tbl-import th:nth-child(5),
  .admin-main table.data.tbl-import td:nth-child(5),
  .admin-main table.data.tbl-import th:nth-child(6),
  .admin-main table.data.tbl-import td:nth-child(6) { display: none; }

  /* Groups list: title | status | actions */
  .admin-main table.data.tbl-groups th:nth-child(1),
  .admin-main table.data.tbl-groups td:nth-child(1),
  .admin-main table.data.tbl-groups th:nth-child(3),
  .admin-main table.data.tbl-groups td:nth-child(3),
  .admin-main table.data.tbl-groups th:nth-child(5),
  .admin-main table.data.tbl-groups td:nth-child(5),
  .admin-main table.data.tbl-groups th:nth-child(6),
  .admin-main table.data.tbl-groups td:nth-child(6),
  .admin-main table.data.tbl-groups th:nth-child(7),
  .admin-main table.data.tbl-groups td:nth-child(7),
  .admin-main table.data.tbl-groups th:nth-child(8),
  .admin-main table.data.tbl-groups td:nth-child(8) { display: none; }
  .admin-main table.data.tbl-groups th:nth-child(2),
  .admin-main table.data.tbl-groups td:nth-child(2) { width: 38%; padding: 5px 4px; }
  .admin-main table.data.tbl-groups th:nth-child(4),
  .admin-main table.data.tbl-groups td:nth-child(4) { width: 16%; padding: 4px 2px; text-align: center; }
  .admin-main table.data.tbl-groups th:nth-child(9),
  .admin-main table.data.tbl-groups td:nth-child(9) {
    width: 46%;
    min-width: 0;
    white-space: normal;
    overflow: hidden;
    padding: 4px 3px;
  }
  .admin-main table.data.tbl-groups .group-row-title {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
  }
  .admin-main table.data.tbl-groups .thumb-in-title {
    display: block;
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
  }
  .admin-main table.data.tbl-groups .group-title-text {
    min-width: 0;
    flex: 1;
  }
  .admin-main table.data.tbl-groups .group-title-text a {
    font-size: .66rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .admin-main table.data.tbl-groups td:nth-child(4) .pill {
    font-size: .5rem;
    padding: 2px 4px;
  }
  .admin-main table.data.tbl-groups td.cell-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    align-items: stretch;
  }
  .admin-main table.data.tbl-groups td.cell-actions .act-form,
  .admin-main table.data.tbl-groups td.cell-actions > a {
    display: block;
    min-width: 0;
    margin: 0;
  }
  .admin-main table.data.tbl-groups td.cell-actions .act-form .btn,
  .admin-main table.data.tbl-groups td.cell-actions .btn-sm,
  .admin-main table.data.tbl-groups td.cell-actions .btn-wa-link {
    width: 100%;
    max-width: 100%;
    padding: 4px 2px;
    font-size: .5rem;
    line-height: 1.15;
    text-align: center;
    box-sizing: border-box;
  }
  .admin-main table.data.tbl-groups .btn-act-mobile .lbl-full { display: none; }
  .admin-main table.data.tbl-groups .btn-act-mobile .lbl-short { display: inline; }

  /* Dashboard recent */
  .admin-main table.data.tbl-dashboard th:nth-child(1),
  .admin-main table.data.tbl-dashboard td:nth-child(1) { width: 28px; padding: 5px 2px; }
  .admin-main table.data.tbl-dashboard th:nth-child(3),
  .admin-main table.data.tbl-dashboard td:nth-child(3) { width: 18%; }
  .admin-main table.data.tbl-dashboard th:nth-child(5),
  .admin-main table.data.tbl-dashboard td:nth-child(5),
  .admin-main table.data.tbl-dashboard th:nth-child(6),
  .admin-main table.data.tbl-dashboard td:nth-child(6),
  .admin-main table.data.tbl-dashboard th:nth-child(7),
  .admin-main table.data.tbl-dashboard td:nth-child(7) { display: none; }
  .admin-main table.data.tbl-dashboard th:nth-child(8),
  .admin-main table.data.tbl-dashboard td:nth-child(8) { width: 14%; padding: 4px 2px; }

  /* Site scanner: checkbox | group | title | link | import */
  .admin-main table.data.tbl-scan th,
  .admin-main table.data.tbl-scan td {
    padding: 16px 6px;
    vertical-align: middle;
  }
  .admin-main table.data.tbl-scan th:nth-child(1),
  .admin-main table.data.tbl-scan td:nth-child(1) { width: 26px; padding: 16px 4px; }
  .admin-main table.data.tbl-scan th:nth-child(5),
  .admin-main table.data.tbl-scan td:nth-child(5),
  .admin-main table.data.tbl-scan th:nth-child(6),
  .admin-main table.data.tbl-scan td:nth-child(6),
  .admin-main table.data.tbl-scan th:nth-child(7),
  .admin-main table.data.tbl-scan td:nth-child(7) { display: none; }
  .admin-main table.data.tbl-scan th:nth-child(3),
  .admin-main table.data.tbl-scan td:nth-child(3) { width: 20%; padding: 16px 5px; }
  .admin-main table.data.tbl-scan th:nth-child(4),
  .admin-main table.data.tbl-scan td:nth-child(4) {
    width: 11%;
    min-width: 0;
    text-align: center;
    padding: 16px 5px;
  }
  .admin-main table.data.tbl-scan th:nth-child(8),
  .admin-main table.data.tbl-scan td:nth-child(8) {
    width: 19%;
    min-width: 0;
    white-space: normal;
    overflow: hidden;
    padding: 14px 5px;
    text-align: center;
  }
  .admin-main table.data.tbl-scan td.cell-group img {
    width: 38px !important;
    height: 38px !important;
  }
  .admin-main table.data.tbl-scan td.cell-group strong {
    font-size: .72rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }
  .admin-main table.data.tbl-scan td.cell-group > div {
    gap: 10px !important;
  }
  .admin-main table.data.tbl-scan .scan-title-select {
    font-size: .65rem;
    padding: 10px 5px;
    min-height: 36px;
  }
  .admin-main table.data.tbl-scan .scan-title-input {
    font-size: .65rem;
    padding: 10px 5px;
    margin-top: 8px !important;
    min-height: 36px;
  }
  .admin-main table.data.tbl-scan .btn-wa-link {
    width: 100%;
    min-width: 0;
    padding: 10px 5px;
    font-size: .62rem;
    min-height: 34px;
  }
  .admin-main table.data.tbl-scan td.cell-wa-link {
    text-align: center;
    vertical-align: middle;
  }
  .admin-main table.data.tbl-scan .scan-import-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0 !important;
    padding: 4px 0;
  }
  .admin-main table.data.tbl-scan .scan-import-btns .btn-sm {
    width: 100%;
    padding: 10px 5px;
    font-size: .6rem;
    line-height: 1.3;
    min-height: 34px;
  }
  .admin-main table.data.tbl-scan .btn-sched .lbl-full { display: none; }
  .admin-main table.data.tbl-scan .btn-sched .lbl-short { display: inline; }
  .admin-main table.data.tbl-scan thead th {
    padding: 14px 6px;
    font-size: .62rem;
  }

  /* Reports */
  .admin-main table.data.tbl-reports th:nth-child(3),
  .admin-main table.data.tbl-reports td:nth-child(3),
  .admin-main table.data.tbl-reports th:nth-child(5),
  .admin-main table.data.tbl-reports td:nth-child(5) { display: none; }
  .admin-main table.data.tbl-reports th:nth-child(6),
  .admin-main table.data.tbl-reports td:nth-child(6) { width: 28%; white-space: normal; overflow: hidden; padding: 4px 2px; }
  .admin-main table.data.tbl-reports td.cell-actions { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .admin-main table.data.tbl-reports td.cell-actions form { display: contents; }
  .admin-main table.data.tbl-reports td.cell-actions .btn-sm { width: 100%; font-size: .52rem; padding: 4px 3px; }

  /* Categories */
  .admin-main table.data.tbl-categories th:nth-child(1),
  .admin-main table.data.tbl-categories td:nth-child(1),
  .admin-main table.data.tbl-categories th:nth-child(2),
  .admin-main table.data.tbl-categories td:nth-child(2),
  .admin-main table.data.tbl-categories th:nth-child(4),
  .admin-main table.data.tbl-categories td:nth-child(4) { display: none; }
  .admin-main table.data.tbl-categories th:nth-child(5),
  .admin-main table.data.tbl-categories td:nth-child(5) { width: 14%; }
  .admin-main table.data.tbl-categories th:nth-child(6),
  .admin-main table.data.tbl-categories td:nth-child(6) { width: 22%; white-space: normal; overflow: hidden; padding: 4px 2px; }

  .admin-main table.data.tbl-results th,
  .admin-main table.data.tbl-results td {
    font-size: .66rem;
  }

  .chips { flex-wrap: wrap; gap: 6px; }
  .chip { font-size: .78rem; padding: 6px 10px; }

  .alert { word-break: break-word; }

  .pagination { flex-wrap: wrap; justify-content: center; }

  .group-hero { grid-template-columns: 1fr; text-align: center; }
  .group-hero img { margin: 0 auto; }
  .group-actions { justify-content: center; }
  .group-tags { justify-content: center; }
  .group-stats-row { justify-content: center; flex-wrap: wrap; gap: 12px 18px; }
}
@media (max-width: 680px) {
  .main-nav {
    position: absolute; top: 62px; left: 0; right: 0; background: var(--wa-dark);
    flex-direction: column; align-items: stretch; padding: 10px 16px; gap: 8px; display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 60;
  }
  body.nav-open .main-nav { display: flex; }
  .nav-toggle { display: flex; }
  .row2 { grid-template-columns: 1fr; }

  .container { padding-left: 12px; padding-right: 12px; }
  .page { padding-top: 16px; padding-bottom: 36px; }

  .hero {
    padding: 22px 16px 20px;
    margin-bottom: 16px;
    text-align: center;
  }
  .hero h1 {
    font-size: 1.35rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
  }
  .hero p { font-size: .92rem; margin-bottom: 14px; }
  .hero .search-form {
    flex-direction: column;
    max-width: none;
    width: 100%;
    gap: 10px;
  }
  .hero .search-form input,
  .hero .search-form .btn { width: 100%; }
  .hero-stats { gap: 16px 22px; }

  .category-section { margin-bottom: 16px; }
  .category-card-img {
    min-height: 82px;
    border-radius: 9px;
  }
  @supports not (aspect-ratio: 2 / 1) {
    .category-card-img { height: 82px; }
  }
  .category-card-emoji { font-size: 2.1rem; }

  .page { min-height: 0; padding-bottom: 32px; }

  .channels-section { margin-bottom: 16px; }
  .channels-section > .section-head { margin-top: 0; }

  .category-page-cover { margin-bottom: 16px; }
  .category-page-header { margin-bottom: 14px; }
  .category-page-header-compact { margin-bottom: 12px; }
  .category-article { margin-bottom: 20px; }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 14px 0 8px;
  }
  .section-head h2 {
    flex: none;
    width: 100%;
    font-size: 1.12rem;
  }
  .toolbar { width: 100%; }
  .toolbar select { width: 100%; }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .card-title { font-size: 1rem; }
  .card-desc { font-size: .86rem; }
  .card-actions {
    flex-direction: column;
    gap: 8px;
  }
  .card-actions .btn { width: 100%; }

  .brand-logo { height: 30px; max-width: min(196px, 62vw); }
  .header-inner { height: 56px; }

  .group-hero { grid-template-columns: 1fr; text-align: center; }
  .group-hero img { margin: 0 auto; max-width: 200px; }
  .group-actions { justify-content: center; flex-wrap: wrap; }
  .group-display-title { font-size: 1.45rem; overflow-wrap: anywhere; }

  .footer-inner { flex-direction: column; gap: 14px; }
  .footer-links { gap: 12px; }
}

@media (max-width: 380px) {
  .category-grid { gap: 10px 8px; }
  .category-card-caption { font-size: .65rem; }
  .channel-strip { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.22rem; }
}
