/* ==========================================================================
   ET 251 NEWS - Modern Responsive Editorial & App-Style Stylesheet
   ========================================================================== */

@view-transition {
  navigation: auto;
}

:root {
  --bg: #ffffff;
  --bg-page: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f3f5f8;
  --surface-hover: #eaeef4;
  --border: #e6e9ef;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #6b7280;
  --accent: #0b84fe;
  --accent-hover: #006be0;
  --accent-soft: #ebf4ff;
  --danger: #ef4444;
  --success: #059669;
  --warn: #d97706;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --header-h: 58px;
  --mbn-h: 66px;
}

@media (min-width: 768px) {
  :root {
    --header-h: 68px;
  }
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-page: #0b0f17;
  --surface: #131924;
  --surface-soft: #1b2332;
  --surface-hover: #242e42;
  --border: #263042;
  --text: #f3f4f6;
  --text-secondary: #d1d5db;
  --muted: #9ca3af;
  --accent: #3898ff;
  --accent-hover: #58a9ff;
  --accent-soft: rgba(56, 152, 255, 0.14);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--mbn-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

a, button, input, select, textarea {
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
}
.skip-link:focus {
  top: 16px;
}

.container {
  width: min(1240px, calc(100% - 28px));
  max-width: 100%;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .container {
    width: min(1240px, calc(100% - 48px));
  }
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-md { margin-bottom: 16px; }
.honeypot-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; pointer-events: none; }

/* Buttons & Pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 8px 14px; font-size: 0.84rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--text); }

.icon-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.18s ease, transform 0.12s ease;
}
@media (min-width: 640px) {
  .icon-pill {
    width: 42px;
    height: 42px;
  }
}
.icon-pill:hover { background: var(--surface-hover); }
.icon-pill:active { transform: scale(0.95); }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
}
.text-link:hover { text-decoration: underline; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.3); }
}

/* Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.site-header--desktop-only {
  display: none;
}
@media (min-width: 768px) {
  .site-header--desktop-only {
    display: block;
  }
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex-shrink: 1;
}
.brand-logo {
  border-radius: 10px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
  min-width: 0;
}
.brand-text strong {
  font-size: clamp(0.9rem, 3.6vw, 1.02rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text small {
  font-size: 0.67rem;
  color: var(--muted);
  font-weight: 600;
}
@media (min-width: 640px) {
  .header-inner { gap: 12px; }
  .header-left { gap: 10px; }
  .brand-logo { width: 34px; height: 34px; }
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.desktop-nav::-webkit-scrollbar { display: none; }

@media (min-width: 1024px) {
  .desktop-nav { display: flex; }
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.nav-link:hover { background: var(--surface-soft); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.search-trigger:hover { background: var(--surface-hover); color: var(--text); }
.search-trigger:active { transform: scale(0.96); }
.search-trigger__label, .search-trigger__kbd { display: none; }

@media (min-width: 640px) {
  .header-actions { gap: 8px; }
  .search-trigger {
    width: auto;
    height: 42px;
    padding: 0 14px;
    min-width: 185px;
    justify-content: flex-start;
    color: var(--muted);
  }
  .search-trigger__label { display: inline; font-size: 0.86rem; font-weight: 500; flex: 1; text-align: left; }
  .search-trigger__kbd {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); font-size: 0.72rem; font-weight: 700;
  }
}

.mobile-only { display: inline-flex; }
.desktop-only { display: none; }
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: inline-flex; }
}

.notif-wrap { position: relative; }
.notif-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface-soft);
}

.saved-badge, .saved-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.saved-badge[hidden], .saved-dot[hidden] { display: none; }

/* Theme icons */
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* Breaking Alerts Popover (Native Popover API) */
.breaking-popover {
  margin: 0;
  inset: auto;
  top: calc(var(--header-h) + 8px);
  right: 16px;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.breaking-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.breaking-popover__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.breaking-popover__list a {
  display: block;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  transition: background-color 0.15s ease;
}
.breaking-popover__list a:hover { background: var(--surface-hover); }
.breaking-popover__cat { display: block; font-size: 0.74rem; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.breaking-popover__title { display: block; font-size: 0.87rem; font-weight: 700; line-height: 1.35; }
.breaking-popover__all {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent);
}

/* Native <dialog> Slide-Over Mobile Drawer & Live Search Modal
   -------------------------------------------------------------------------- */
dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(5px);
}

.drawer-dialog {
  margin: 0;
  padding: 0;
  border: none;
  height: 100dvh;
  max-height: 100dvh;
  width: min(340px, 86vw);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
}

.drawer-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
}
.drawer-section { margin-bottom: 20px; }
.drawer-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
  margin: 0 0 8px;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
}
.drawer-link:hover { background: var(--surface-soft); }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Live Search Modal */
.search-dialog {
  border: none;
  padding: 0;
  margin: 10px auto auto;
  width: min(740px, calc(100vw - 20px));
  max-height: 88dvh;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  overscroll-behavior: contain;
}
@media (min-width: 640px) {
  .search-dialog {
    margin: 4vh auto auto;
    width: min(740px, calc(100vw - 32px));
    max-height: 86dvh;
    border-radius: var(--radius-lg);
  }
}
.search-dialog__box {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
}
.search-dialog__top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.live-search-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  padding: 9px 13px;
  border-radius: 999px;
}
.live-search-input-wrap input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
}
.clear-btn {
  border: none;
  background: var(--surface-hover);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.clear-btn[hidden] { display: none; }

.search-dialog__filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-dialog__filters .chip-row {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 640px) {
  .search-dialog__filters {
    padding: 12px 16px;
    gap: 12px;
  }
  .search-dialog__filters .chip-row {
    flex: 1 1 auto;
  }
}
.sort-select {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 600;
}
.search-dialog__status {
  padding: 10px 14px 4px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.search-dialog__results {
  overflow-y: auto;
  padding: 8px 14px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.live-result-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.live-result-item > div {
  min-width: 0;
}
.live-result-item:hover, .live-result-item.is-focused {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.live-result-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
}
@media (min-width: 640px) {
  .live-result-item {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .live-result-item img {
    width: 74px;
    height: 74px;
  }
}
.live-result-item h4 {
  margin: 2px 0 4px;
  font-size: 0.96rem;
  line-height: 1.3;
}
.live-result-item mark {
  background: rgba(11, 132, 254, 0.2);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}
.search-dialog__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
  text-align: right;
  font-size: 0.88rem;
}

/* Home Hero & Breaking News Carousel (Left Mockup)
   -------------------------------------------------------------------------- */
.home-hero-section {
  padding: 14px 0 8px;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.breaking-block {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .home-hero-section {
    padding: 20px 0 12px;
  }
  .home-hero-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    gap: 24px;
    align-items: start;
  }
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title {
  margin: 0;
  font-size: clamp(1.24rem, 2.4vw, 1.62rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.section-title--sm {
  font-size: 1.15rem;
}
@media (min-width: 768px) {
  .section-head { margin-bottom: 14px; }
  .section-title--sm { font-size: 1.25rem; }
}
.view-all-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.view-all-link:hover { text-decoration: underline; }

.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #0f172a;
}

.hero-carousel__track {
  display: flex;
  width: 100%;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  position: relative;
}

.hero-slide__link {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 210px;
  max-height: 270px;
  width: 100%;
}
@media (min-width: 640px) {
  .hero-carousel { border-radius: var(--radius-lg); }
  .hero-slide__link {
    min-height: 280px;
    max-height: 430px;
  }
}

.hero-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, rgba(15, 23, 42, 0.42) 48%, rgba(10, 15, 28, 0.93) 100%);
}

.hero-slide__top {
  position: absolute;
  top: 14px;
  left: 14px;
}

.hero-slide__bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  color: #fff;
}
@media (min-width: 640px) {
  .hero-slide__top { top: 16px; left: 16px; }
  .hero-slide__bottom { left: 20px; right: 20px; bottom: 20px; }
}

.hero-slide__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  margin-bottom: 5px;
}

.hero-slide__title {
  margin: 0;
  font-size: clamp(1.06rem, 4.1vw, 1.72rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.52);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
@media (min-width: 768px) {
  .carousel-arrow { display: inline-flex; }
}
.carousel-arrow--prev { left: 14px; }
.carousel-arrow--next { right: 14px; }
.carousel-arrow:hover { background: rgba(11, 132, 254, 0.85); }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
.carousel-dot {
  height: 6px;
  width: 8px;
  border-radius: 999px;
  border: none;
  background: var(--border);
  cursor: pointer;
  transition: width 0.25s ease, background-color 0.25s ease;
  padding: 0;
}
.carousel-dot.is-active {
  width: 24px;
  background: var(--accent);
}

/* Trending Rail (Horizontal snap strip on mobile/tablet, desktop rail at 1024px+) */
.trending-rail {
  min-width: 0;
  max-width: 100%;
}
.trending-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(242px, 78%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.trending-list::-webkit-scrollbar { display: none; }

.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
  min-width: 0;
}
.trending-item__body {
  min-width: 0;
  flex: 1;
}
.trending-rank {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.78;
  line-height: 1.1;
  min-width: 24px;
  flex-shrink: 0;
}
.trending-item__body h3 {
  margin: 3px 0 5px;
  font-size: 0.92rem;
  line-height: 1.34;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.trending-item:hover h3 { color: var(--accent); }

@media (min-width: 640px) and (max-width: 1023px) {
  .trending-list {
    grid-auto-columns: minmax(270px, 46%);
  }
}

@media (min-width: 1024px) {
  .trending-rail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
  }
  .trending-list {
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }
  .trending-item {
    gap: 12px;
    padding: 0 0 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .trending-item:last-child { border-bottom: none; padding-bottom: 0; }
  .trending-rank { font-size: 1.15rem; min-width: 26px; opacity: 0.72; }
  .trending-item__body h3 { font-size: 0.94rem; -webkit-line-clamp: 3; }
}

/* Category Chips & Recommendation Feed
   -------------------------------------------------------------------------- */
.home-feed-section {
  padding: 10px 0 44px;
}
.home-filter-bar {
  margin-bottom: 14px;
  min-width: 0;
  max-width: 100%;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0 4px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.87rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.chip:hover { background: var(--surface-hover); color: var(--text); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(11, 132, 254, 0.24);
}

.news-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.news-main-col,
.news-sidebar-col {
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 1024px) {
  .home-feed-section { padding: 14px 0 48px; }
  .home-filter-bar { margin-bottom: 18px; }
  .news-layout-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
  }
}

.article-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .article-feed { gap: 14px; }
}

/* News Card: Horizontal thumbnail-left on mobile (matching mockup), rich card on wider viewports */
.news-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  padding: 11px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  align-items: center;
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.news-card__content {
  min-width: 0;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

@media (min-width: 640px) {
  .news-card {
    grid-template-columns: 185px minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
    border-radius: var(--radius-md);
  }
}

.news-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-soft);
}
@media (min-width: 640px) {
  .news-card__media {
    aspect-ratio: 16 / 11;
  }
}
.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.news-card:hover .news-card__media img {
  transform: scale(1.04);
}

.news-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-cat {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
a.card-cat:hover { color: var(--accent); }

.bookmark-mini {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bookmark-mini:hover { background: var(--surface-soft); color: var(--accent); }
.bookmark-mini.is-saved svg { fill: var(--accent); stroke: var(--accent); }

.news-card__title {
  margin: 2px 0 6px;
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.news-card__title a:hover { color: var(--accent); }

.news-card__excerpt {
  display: none;
  margin: 0 0 10px;
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 640px) {
  .news-card__excerpt { display: -webkit-box; }
}

.news-card__author {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.news-card__author img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.news-card__author > span:first-of-type {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-card__author > time,
.news-card__author > .dot-sep {
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .news-card__author {
    gap: 6px;
    font-size: 0.8rem;
  }
  .news-card__author img {
    width: 22px;
    height: 22px;
  }
}
.card-meta { font-size: 0.78rem; color: var(--muted); }
.verified-icon { flex-shrink: 0; vertical-align: middle; }

/* Sidebar Cards & Policy Lists */
.news-sidebar-col, .article-sidebar, .policy-sidebar, .contact-info-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 1024px) {
  .news-sidebar-col, .article-sidebar, .policy-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 18px);
  }
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.sidebar-card h2, .sidebar-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 800;
}

.policy-quick-list, .policy-nav-list, .sitemap-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 6px;
}
.policy-quick-list a, .policy-nav-list a, .sitemap-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.policy-quick-list a:hover, .policy-nav-list a:hover, .sitemap-list a:hover {
  background: var(--surface-soft);
  color: var(--accent);
}
.policy-nav-list a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* Discover Page (Center Mockup)
   -------------------------------------------------------------------------- */
.discover-page {
  padding: 14px 0 44px;
}
.discover-container {
  max-width: 860px;
}
.discover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.discover-title-wrap h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.discover-title-wrap p {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.discover-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.discover-search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.discover-search-bar .search-icon { color: var(--muted); flex-shrink: 0; }
.discover-search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
}
.filter-trigger-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.filter-trigger-btn:hover { background: var(--surface-hover); }

.discover-filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.discover-filter-panel[hidden] { display: none; }
.discover-chips { margin-bottom: 14px; min-width: 0; max-width: 100%; }
.discover-status-bar {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Article Reading View (Right Mockup)
   -------------------------------------------------------------------------- */
.article-hero {
  position: relative;
  min-height: clamp(320px, 52svh, 460px);
  display: flex;
  align-items: stretch;
  background: #0f172a;
  overflow: hidden;
}
.article-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.25) 40%, rgba(10, 15, 28, 0.93) 100%);
}
.article-hero__overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding-top: max(16px, env(safe-area-inset-top, 16px));
  padding-bottom: 42px;
  color: #fff;
}
.article-hero__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-hero__actions {
  display: flex;
  gap: 10px;
}
.glass-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.44);
  color: #fff;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.glass-btn:hover { background: rgba(11, 132, 254, 0.85); }
.glass-btn.is-saved svg { fill: #fff; }

.article-hero__headline-wrap { max-width: 820px; }
.article-hero__title {
  margin: 10px 0 8px;
  font-size: clamp(1.36rem, 4.2vw, 2.35rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.article-hero__meta {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.article-sheet {
  position: relative;
  z-index: 3;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  margin-top: -24px;
  padding: 22px 0 48px;
  border-top: 1px solid var(--border);
}
@media (min-width: 1024px) {
  .article-sheet {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 36px 0 64px;
  }
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.article-main {
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 32px;
    align-items: start;
  }
}

.article-publisher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.publisher-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.publisher-identity img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}
.publisher-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}
.publisher-role {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}
.standards-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.standards-pill:hover { color: var(--accent); border-color: var(--accent); }

.article-lead {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 20px;
}

.article-prose {
  font-size: clamp(1rem, 3.8vw, 1.04rem);
  line-height: 1.74;
  color: var(--text-secondary);
  max-width: 72ch;
  overflow-wrap: anywhere;
}
.article-prose h2 {
  color: var(--text);
  font-size: clamp(1.22rem, 3.8vw, 1.38rem);
  margin: 26px 0 10px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.article-prose h3 {
  color: var(--text);
  font-size: 1.12rem;
  margin: 20px 0 8px;
}
.article-prose p { margin: 0 0 16px; }
.article-prose ul, .article-prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.article-prose li { margin-bottom: 8px; }
.article-prose a { color: var(--accent); text-decoration: underline; }
.article-prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text);
  font-weight: 600;
}
.article-prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}
.article-prose th, .article-prose td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.article-prose th { background: var(--surface-soft); color: var(--text); }

.policy-callout {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  margin: 18px 0;
}

.article-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0;
  font-size: 0.88rem;
  font-weight: 700;
}
.tag-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); }

.author-eeat-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin: 26px 0;
}
.author-eeat-box > div { min-width: 0; }
@media (min-width: 520px) {
  .author-eeat-box {
    flex-direction: row;
    gap: 16px;
    padding: 20px;
  }
}
.author-eeat-box img { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; }
.author-eeat-box .eyebrow { margin: 0 0 4px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 800; }
.author-eeat-box h3 { margin: 0 0 6px; font-size: 1.05rem; }
.author-eeat-box h3 span { font-weight: 500; color: var(--muted); }
.author-eeat-box p { margin: 0 0 6px; font-size: 0.92rem; }

/* Comments */
.comments-section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.comments-section h2 { margin: 0 0 16px; font-size: 1.3rem; }
.comment-form {
  background: var(--surface-soft);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.comment-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.comment-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow-wrap: anywhere;
}
.comment-item__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.86rem;
}
.comment-item__head span { color: var(--muted); }
.comment-item p { margin: 0; font-size: 0.94rem; }

.related-list { display: grid; gap: 12px; }
.related-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: center;
}
.related-card img { width: 78px; height: 78px; border-radius: 12px; object-fit: cover; }
.related-card h4 { margin: 2px 0 4px; font-size: 0.9rem; line-height: 1.32; }
.related-card:hover h4 { color: var(--accent); }

/* AdSense Slots (Zero-CLS)
   -------------------------------------------------------------------------- */
.ad-slot {
  margin: 16px auto;
  width: min(1240px, calc(100% - 28px));
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.article-main .ad-slot,
.news-sidebar-col .ad-slot {
  width: 100%;
}
@media (min-width: 768px) {
  .ad-slot {
    width: min(1240px, calc(100% - 48px));
  }
}
.ad-slot__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.ad-slot__hint { font-size: 0.82rem; color: var(--muted); }

/* Banner, Policy & Contact Pages
   -------------------------------------------------------------------------- */
.page-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}
.page-banner h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.page-banner .lead {
  margin: 0 0 8px;
  color: var(--text-secondary);
  max-width: 72ch;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb a:hover { color: var(--accent); }
.page-banner__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.section-pad { padding: 22px 0 48px; }

.policy-layout, .contact-grid, .sitemap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
@media (min-width: 960px) {
  .page-banner { padding: 28px 0; }
  .section-pad { padding: 30px 0 56px; }
  .policy-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  .contact-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
  .sitemap-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
}

.policy-card, .contact-card {
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 34px);
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}
.contact-detail {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.contact-detail:last-child { border-bottom: none; }
.contact-detail strong { display: block; font-size: 0.86rem; color: var(--muted); }
.contact-detail a { color: var(--accent); font-weight: 600; }
.contact-detail p { margin: 4px 0 0; font-size: 0.92rem; }

.sitemap-articles-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}
.sitemap-articles-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.saved-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.page-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.page-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Forms & Alerts
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 0.86rem;
  font-weight: 700;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 1rem;
  background: var(--surface);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
@media (min-width: 768px) {
  .field input, .field select, .field textarea {
    font-size: 0.94rem;
  }
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row-2, .form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
@media (min-width: 640px) {
  .form-row-2, .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 10px 0 16px;
  font-weight: 600;
  font-size: 0.9rem;
}
.checkbox-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.alert {
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  font-weight: 600;
}
.alert--success { background: rgba(5, 150, 105, 0.12); color: var(--success); border: 1px solid rgba(5, 150, 105, 0.25); }
.alert--error { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }
.alert ul { margin: 0; padding-left: 18px; }

/* Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
@media (min-width: 640px) and (max-width: 959px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .footer-brand-col {
    grid-column: 1 / -1;
  }
}
@media (min-width: 960px) {
  .site-footer { padding: 44px 0 28px; }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 28px;
  }
}
.footer-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 12px 0 16px;
}
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.newsletter-form input {
  flex: 1 1 180px;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 1rem;
  background: var(--surface-soft);
}
@media (min-width: 768px) {
  .newsletter-form input { font-size: 0.92rem; }
}
.newsletter-msg { font-size: 0.84rem; margin: 8px 0 0; min-height: 1.2em; }

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 800;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer-col a, .footer-link-btn {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.footer-col a:hover, .footer-link-btn:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--muted);
}
.footer-bottom a { color: var(--accent); }

/* Mobile App-Style Bottom Navigation Bar (Left Mockup)
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  height: calc(var(--mbn-h) + env(safe-area-inset-bottom, 0px));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-around;
}
@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
}
.mbn-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.mbn-item:active { transform: scale(0.95); }
.mbn-item span { display: none; }
.mbn-item.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 132, 254, 0.28);
}
.mbn-item.is-active span { display: inline; }

/* Cookie Consent Banner & Modal
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(var(--mbn-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 80;
  margin-inline: auto;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
}
.cookie-banner[hidden] { display: none; }
@media (min-width: 768px) {
  .cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 20px;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
  }
}
.cookie-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cookie-banner__copy { flex: 1 1 280px; }
.cookie-banner__copy p { margin: 4px 0 0; font-size: 0.84rem; color: var(--text-secondary); }
.cookie-banner__copy a { color: var(--accent); text-decoration: underline; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; justify-content: flex-end; }
@media (max-width: 479px) {
  .cookie-banner__actions {
    width: 100%;
    justify-content: stretch;
  }
  .cookie-banner__actions .btn {
    flex: 1 1 auto;
  }
}

.modal-dialog {
  border: none;
  padding: 0;
  width: min(520px, calc(100vw - 24px));
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.modal-head, .modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-foot { border-bottom: none; border-top: 1px solid var(--border); gap: 10px; justify-content: flex-end; }
.modal-body { padding: 16px 20px; display: grid; gap: 14px; }
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.pref-row p { margin: 3px 0 0; font-size: 0.82rem; color: var(--muted); }

/* Toast */
.toast-region {
  position: fixed;
  bottom: calc(var(--mbn-h) + 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  display: grid;
  gap: 8px;
}
@media (min-width: 768px) {
  .toast-region { bottom: 24px; }
}
.toast {
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* Setup Wizard & Executive Admin CMS Studio
   -------------------------------------------------------------------------- */
.setup-body {
  background: var(--bg-page);
  padding: 28px 16px;
}
.admin-auth-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 15%, rgba(11, 132, 254, 0.14), transparent 44%),
    radial-gradient(circle at 88% 82%, rgba(124, 58, 237, 0.12), transparent 42%),
    var(--bg-page);
}
.setup-shell {
  width: min(760px, 100%);
  margin-inline: auto;
}
.setup-shell--narrow { width: min(450px, 100%); }
.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.admin-auth-card {
  box-shadow: var(--shadow-lg);
  border-radius: 24px;
  padding: 30px 26px;
}
.admin-auth-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.admin-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.admin-pw-wrap input {
  width: 100%;
  padding-right: 68px;
}
.admin-pw-toggle {
  position: absolute;
  right: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}
.admin-pw-toggle:hover { background: var(--surface-hover); color: var(--text); }
.admin-auth-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.setup-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.setup-brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.setup-brand p { margin: 3px 0 0; color: var(--muted); font-size: 0.86rem; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.admin-body {
  padding-bottom: 0;
  background: var(--bg-page);
}
.admin-body.admin-drawer-open { overflow: hidden; }
.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 25, 0.56);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.admin-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
}

/* Sleek Dark-Slate Studio Sidebar */
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(278px, 86vw);
  z-index: 90;
  background: linear-gradient(180deg, #0b1220 0%, #10192b 100%);
  color: #e2e8f0;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow-y: auto;
  transform: translateX(-104%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.admin-sidebar.is-open { transform: translateX(0); }
.admin-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-decoration: none;
  min-width: 0;
}
.admin-brand strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.admin-brand small {
  display: block;
  color: #94a3b8;
  font-size: 0.72rem;
}
.admin-sidebar__close {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-sidebar__close svg,
.admin-menu-trigger svg,
.admin-theme-btn svg,
.admin-nav-ico svg { width: 17px; height: 17px; display: block; }

.admin-compose-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b84fe 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 20px rgba(11, 132, 254, 0.28);
  transition: transform 0.16s ease, filter 0.16s ease;
}
.admin-compose-cta:hover { filter: brightness(1.08); transform: translateY(-1px); color: #ffffff; }

.admin-nav-groups {
  display: grid;
  gap: 16px;
}
.admin-nav-heading {
  display: block;
  padding: 0 10px;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.admin-nav-list {
  display: grid;
  gap: 3px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #cbd5e1;
  transition: background-color 0.15s ease, color 0.15s ease;
  min-width: 0;
}
.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
.admin-nav-link.is-active {
  background: rgba(11, 132, 254, 0.2);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #3898ff;
}
.admin-nav-link.is-active .admin-nav-ico { color: #60a5fa; }
.admin-nav-ico {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-nav-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 152, 255, 0.24);
  color: #bfdbfe;
  line-height: 1.3;
}
.admin-nav-badge.tone-danger { background: rgba(239, 68, 68, 0.24); color: #fecaca; }
.admin-nav-badge.tone-warn { background: rgba(245, 158, 11, 0.24); color: #fde68a; }
.admin-nav-badge.tone-muted { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

.admin-sidebar__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: grid;
  gap: 10px;
}
.admin-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  min-width: 0;
}
.admin-user-card:hover { background: rgba(255, 255, 255, 0.09); color: #ffffff; }
.admin-avatar-badge,
.admin-avatar-mini {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #ffffff;
  background: var(--role-tint, #1a82e2);
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.admin-avatar-mini { width: 28px; height: 28px; border-radius: 9px; font-size: 0.7rem; }
.admin-user-meta {
  display: grid;
  min-width: 0;
}
.admin-user-meta strong {
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-role-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  color: #cbd5e1;
}
.admin-role-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--role-tint, #3898ff);
}
.admin-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
}
.admin-logout-btn:hover { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.35); color: #fecaca; }

/* Main Workspace & Top Command Bar */
.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}
.admin-topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.admin-menu-trigger {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-topbar h1 {
  margin: 0;
  font-size: clamp(1.06rem, 3.5vw, 1.32rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.admin-topbar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-util-pills {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.admin-util-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
}
.admin-util-pill:hover { background: var(--surface); color: var(--accent); }
.admin-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.admin-theme-btn:hover { background: var(--surface-hover); color: var(--text); }
.admin-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.admin-topbar-user:hover { border-color: var(--accent); }
.admin-topbar-user__name { display: none; }

.admin-content {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  flex: 1 0 auto;
  align-content: start;
}
.admin-content > *,
.admin-two-col > *,
.admin-panel .stack-form,
.audit-row > div {
  min-width: 0;
}
.admin-footer-bar {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
}
.admin-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-flash__close {
  border: none;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}
.admin-flash__close:hover { opacity: 1; }

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}
.admin-panel h2 { margin: 0 0 8px; font-size: 1.1rem; letter-spacing: -0.015em; }
.admin-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-panel__head p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

@media (min-width: 640px) {
  .admin-util-pills { display: inline-flex; }
  .admin-topbar-user__name { display: inline; }
}

@media (min-width: 1024px) {
  .admin-shell { grid-template-columns: 268px minmax(0, 1fr); }
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    width: auto;
    transform: none;
    padding: 20px 14px;
  }
  .admin-sidebar__close,
  .admin-menu-trigger,
  .admin-drawer-backdrop { display: none !important; }
  .admin-topbar { padding: 14px 26px; }
  .admin-content { padding: 24px 26px; gap: 22px; }
  .admin-panel { padding: 22px; }
  .admin-two-col { grid-template-columns: 1.28fr 1fr; align-items: start; gap: 22px; }
  .admin-two-col--balanced { grid-template-columns: 1fr 1fr; }
}

/* KPI Grid & Quick Studio Tiles */
.admin-stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
}
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--kpi-tint, var(--accent));
}
.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-label { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { display: block; font-size: 1.85rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 4px 0 2px; }
.stat-sub { font-size: 0.8rem; color: var(--muted); }
.stat-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-quick-tiles {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
}
.admin-quick-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.admin-quick-tile:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
}
.admin-quick-tile__ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.admin-quick-tile__ico svg { width: 17px; height: 17px; }

/* Toolbar, Filter Bars, Bulk Actions & Badges */
.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.admin-search-input {
  min-width: 190px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.86rem;
}
.admin-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.admin-bulk-bar.has-selection {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-tab {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border: 1px solid transparent;
}
.admin-tab:hover { background: var(--surface-hover); }
.admin-tab.is-active {
  background: var(--accent);
  color: #ffffff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  background: var(--surface-soft);
  color: var(--text-secondary);
}
.status-pill.is-success { background: rgba(5, 150, 105, 0.14); color: #059669; }
.status-pill.is-warn { background: rgba(217, 119, 6, 0.15); color: #b45309; }
.status-pill.is-danger { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.status-pill.is-info { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .status-pill.is-success { color: #34d399; }
[data-theme="dark"] .status-pill.is-warn { color: #fbbf24; }
[data-theme="dark"] .status-pill.is-danger { color: #f87171; }

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--role-tint, var(--accent));
  background: color-mix(in srgb, var(--role-tint, var(--accent)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--role-tint, var(--accent)) 28%, transparent);
}

.btn-xs {
  padding: 5px 10px;
  font-size: 0.76rem;
  border-radius: 8px;
}
.btn-danger-outline {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: transparent;
  color: var(--danger);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger-outline:hover { background: rgba(239, 68, 68, 0.1); }

/* Progress bars & Permission Matrix */
.dist-list { display: grid; gap: 11px; }
.dist-row { display: grid; gap: 5px; }
.dist-row__meta { display: flex; justify-content: space-between; font-size: 0.84rem; font-weight: 600; }
.dist-bar { height: 8px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.dist-bar span { display: block; height: 100%; border-radius: 999px; background: var(--bar-tint, var(--accent)); }

.perm-groups { display: grid; gap: 14px; }
.perm-group-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-soft);
}
.perm-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.perm-group-head strong { font-size: 0.9rem; }
.perm-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.83rem;
}
.perm-item:hover { border-color: var(--accent); }
.perm-item input { margin-top: 2px; flex-shrink: 0; }
.perm-item strong { display: block; font-size: 0.84rem; margin-bottom: 2px; }
.perm-item span { display: block; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }

.roles-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.role-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface);
  display: grid;
  gap: 10px;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}
.role-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--role-tint, var(--accent));
}
.role-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.role-card__desc { margin: 0; color: var(--muted); font-size: 0.83rem; line-height: 1.45; }
.role-card__perms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.role-perm-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.admin-user-cell strong { display: block; }
.admin-user-cell small { display: block; color: var(--muted); }

.audit-score-pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
}
.audit-list { display: grid; gap: 10px; }
.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.audit-row.is-pass { background: rgba(5, 150, 105, 0.06); border-color: rgba(5, 150, 105, 0.22); }
.audit-row.is-pending { background: rgba(11, 132, 254, 0.06); }
.audit-row.is-warn { background: rgba(217, 119, 6, 0.08); }
.audit-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
}
.audit-row p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }

.table-wrap { overflow-x: auto; max-width: 100%; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-soft);
}
.admin-table th, .admin-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--surface-soft) 65%, transparent); }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; align-items: center; gap: 4px; }
.link-danger { border: none; background: none; color: var(--danger); font-weight: 600; cursor: pointer; padding: 0; }
.text-warn { color: var(--warn); font-weight: 700; }

.inbox-list { display: grid; gap: 12px; }
.inbox-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.inbox-card.is-unread { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.inbox-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; margin-bottom: 6px; }
.inbox-card__body { margin: 8px 0 12px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

