/**
 * Komunitas Multi-Room & Shell Layout CSS (Tema Gelap Terpadu 2026)
 * Sesuai mockup Figma/Design: #0b0e14 background, #131923 card, #ff7a00 aksen.
 */

:root {
  --km-bg: #0b0e14;
  --km-sidebar-bg: #0f141c;
  --km-card-bg: #131923;
  --km-card-border: rgba(255, 255, 255, 0.08);
  --km-card-hover: #171f2c;
  --km-orange: #ff7a00;
  --km-orange-glow: rgba(255, 122, 0, 0.15);
  --km-green: #00c278;
  --km-green-glow: rgba(0, 194, 120, 0.15);
  --km-blue: #38bdf8;
  --km-text-main: #f3f4f6;
  --km-text-sub: #9ca3af;
  --km-text-muted: #6b7280;
  --km-touch-min: 44px;
  --community-visual-height: 100dvh;
}

/* Touch Target Minimum 44x44px Guard */
.btn-hamburger,
.btn-drawer-close,
.btn-bell-mobile,
.btn-salin-kecil,
.community-nav-item,
.km-pill,
.km-btn-action,
.tj-btn {
  min-height: 44px;
  min-width: 44px;
}

/* Reset & Container Shell */
html,
body.komunitas-body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: var(--community-visual-height, 100dvh);
  background-color: var(--km-bg);
  color: var(--km-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.drawer-open {
  overflow: hidden !important;
}

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

.community-app {
  position: fixed;
  top: var(--pwa-install-banner-height, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(100% - var(--pwa-install-banner-height, 0px));
  height: calc(var(--community-visual-height, 100dvh) - var(--pwa-install-banner-height, 0px));
  display: flex;
  overflow: hidden;
  background-color: var(--km-bg);
}

/* =========================================================
   SIDEBAR DESKTOP
   ========================================================= */
.community-sidebar {
  width: 210px;
  flex-shrink: 0;
  background-color: var(--km-sidebar-bg);
  border-right: 1px solid var(--km-card-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  box-sizing: border-box;
  z-index: 20;
}

@media (min-width: 1200px) {
  .community-sidebar {
    width: 250px;
    padding: 24px 16px;
  }
}

.community-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 20px 6px;
  text-decoration: none;
}

.community-brand img {
  height: 28px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.community-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.community-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--km-text-sub);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  min-height: var(--km-touch-min);
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
}

.community-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--km-text-main);
}

.community-nav-item.active {
  background-color: var(--km-orange-glow);
  color: var(--km-orange);
  font-weight: 600;
}

.community-nav-item.disabled,
.btn-bell-mobile.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.community-nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.community-badge {
  margin-left: auto;
  background-color: var(--km-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1;
}

/* User Card at bottom */
.community-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: auto;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--km-card-border);
  text-decoration: none;
  color: inherit;
  min-height: var(--km-touch-min);
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease;
  min-width: 0;
  width: 100%;
}

.community-user-card:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.community-user-ava {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e2638;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
}

.community-user-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.community-user-ava.guest {
  background: #2a3349;
  color: #94a3b8;
}

.km-presence-dot-ava {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--km-green);
  border: 2px solid var(--km-sidebar-bg);
  box-sizing: content-box;
}

.community-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.community-user-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.community-user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--km-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.community-user-handle {
  font-size: 12px;
  color: var(--km-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.community-user-chevron {
  color: var(--km-text-muted);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
.community-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--km-bg);
  box-sizing: border-box;
}

.community-main.km-main-room {
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.community-scroll-wrap {
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  padding: 22px 24px 48px 24px;
  box-sizing: border-box;
}

.community-scroll-wrap.km-scroll-wrap-room {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .community-sidebar {
    width: 260px;
    padding: 24px 16px;
  }
  .community-scroll-wrap {
    max-width: 1380px;
    padding: 28px 36px 64px 36px;
  }
  .km-page-title {
    font-size: 25px;
  }
  .km-page-subtitle {
    font-size: 14px;
  }
  .km-featured-room {
    padding: 18px 22px;
  }
  .km-featured-name {
    font-size: 14px;
  }
  .km-featured-bell {
    font-size: 10px;
    padding: 4px 8px;
  }
  .km-featured-desc {
    font-size: 12px;
  }
  .community-nav-item {
    font-size: 14px;
    padding: 10px 14px;
  }
}

@media (min-width: 1440px) {
  .community-sidebar {
    width: 270px;
    padding: 26px 18px;
  }
  .community-scroll-wrap {
    max-width: 1400px;
    padding: 32px 48px 72px 48px;
  }
  .km-page-title {
    font-size: 27px;
  }
  .km-page-subtitle {
    font-size: 14.5px;
  }
  .km-featured-room {
    padding: 20px 24px;
  }
  .km-featured-name {
    font-size: 15px;
  }
  .km-featured-bell {
    font-size: 10.5px;
    padding: 5px 9px;
  }
  .km-featured-desc {
    font-size: 12.5px;
  }
  .kanal-baris {
    padding: 13px 18px;
    gap: 14px;
  }
  .kanal-baris .ava {
    width: 46px;
    height: 46px;
    font-size: 14.5px;
  }
}

/* Header Section */
.km-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.km-page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 3px 0;
  color: var(--km-text-main);
}

.km-page-subtitle {
  font-size: 13px;
  color: var(--km-text-sub);
  margin: 0;
}

.km-page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.km-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--km-card-border);
  color: var(--km-text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.km-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--km-text-main);
}

/* Security Notice Banner */
.km-security-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 10px;
  margin-bottom: 16px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.km-security-card .shield-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--km-blue);
}

.km-security-info {
  flex: 1;
  min-width: 0;
}

.km-security-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #f0f9ff;
  margin-bottom: 2px;
  line-height: 1.3;
}

.km-security-info p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.3;
}

.w-hitung {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--km-green);
  background: rgba(0, 194, 120, 0.12);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Search Bar & Filters */
.km-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.km-search-box {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.km-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--km-text-muted);
  pointer-events: none;
}

.km-search-input {
  width: 100%;
  height: 42px;
  min-height: var(--km-touch-min);
  background-color: var(--km-card-bg);
  border: 1px solid var(--km-card-border);
  border-radius: 8px;
  padding: 0 16px 0 42px;
  font-size: 13.5px;
  color: var(--km-text-main);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease;
}

.km-search-input:focus {
  border-color: var(--km-orange);
}

.km-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.km-pills::-webkit-scrollbar {
  display: none;
}

.km-pill {
  padding: 6px 16px;
  min-height: 34px;
  border-radius: 999px;
  background-color: var(--km-card-bg);
  border: 1px solid var(--km-card-border);
  color: var(--km-text-sub);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.km-pill:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--km-text-main);
}

.km-pill.active {
  background-color: var(--km-orange);
  border-color: var(--km-orange);
  color: #fff;
  font-weight: 600;
}

/* =========================================================
   Featured Room Card (Free Fire) — Berbasis Mockup Final
   ========================================================= */
.km-featured-room {
  position: relative;
  overflow: hidden;
  background: linear-gradient(125deg, #121a2b, #101622 68%, #131927);
  border: 1px solid #2b3548;
  border-radius: 15px;
  padding: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  margin-bottom: 22px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.km-featured-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.km-featured-ava {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #22277d;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  padding: 0;
  box-sizing: border-box;
}

.km-featured-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.km-featured-head-copy {
  min-width: 0;
  flex: 1;
}

.km-featured-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.km-featured-name {
  min-width: 0;
  white-space: nowrap;
  font-size: clamp(10.5px, 3.2vw, 12.5px);
  font-weight: 850;
  display: flex;
  gap: 4px;
  align-items: center;
  line-height: 1.15;
  color: var(--km-text-main, #f7f8fb);
}

.km-featured-name span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.km-featured-desc {
  color: #a2acc0;
  font-size: 11px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.km-featured-bell {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #3c2116;
  border: 1px solid #783b20;
  color: #ffb47d;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: clamp(8.5px, 2.5vw, 9.5px);
  font-weight: 850;
  white-space: nowrap;
  line-height: 1;
}

.km-featured-bell svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.km-featured-bell.ring svg {
  animation: ring 0.72s ease-out 1;
  transform-origin: 50% 10%;
}

@keyframes ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(13deg); }
  40% { transform: rotate(-11deg); }
  60% { transform: rotate(7deg); }
  80% { transform: rotate(-4deg); }
}

.km-featured-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 10px;
  color: #dce0e9;
  font-size: 12px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.km-featured-faces {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.km-featured-face {
  width: 23px;
  height: 23px;
  border: 2px solid #131a2a;
  border-radius: 50%;
  margin-left: -5px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 9px;
  font-weight: 900;
  background: #2e6e8f;
  overflow: hidden;
  font-style: normal;
  flex-shrink: 0;
}

.km-featured-face:first-child {
  margin-left: 0;
}

.km-featured-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.km-featured-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14d98a;
  box-shadow: 0 0 10px rgba(20, 217, 138, 0.6);
  flex-shrink: 0;
}

.km-featured-sep {
  width: 1px;
  height: 13px;
  background: #465065;
  flex-shrink: 0;
}

.km-featured-preview {
  border: 1px solid #2c3548;
  background: rgba(7, 11, 18, 0.62);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0;
}

.km-featured-preview-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #9fa9bc;
  border-bottom: 1px solid rgba(55, 65, 83, 0.55);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.km-featured-preview-head svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.km-featured-ticker-window {
  height: 108px;
  overflow: hidden;
  position: relative;
}

.km-featured-ticker-track {
  transition: transform 0.68s cubic-bezier(0.22, 0.7, 0.25, 1);
}

.km-featured-msg {
  height: 36px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}

.km-featured-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 9px;
  font-weight: 900;
  background: #2e6e8f;
  overflow: hidden;
  font-style: normal;
  flex-shrink: 0;
}

.km-featured-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.km-featured-msg-copy {
  min-width: 0;
}

.km-featured-msg-copy b {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  color: #f7f8fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.km-featured-msg-copy span {
  display: block;
  color: #b8c0cf;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.km-featured-ticker-empty {
  height: 108px;
  display: grid;
  place-items: center;
  color: #8a96a9;
  font-size: 12px;
  padding: 12px;
  text-align: center;
}

.km-featured-cta {
  width: 100%;
  height: 47px;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: linear-gradient(180deg, #ff8b18, #f56b00);
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(255, 111, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.km-featured-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.km-featured-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 111, 0, 0.32);
  color: #fff;
}

.km-featured-cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Reduced Motion Fallback */
@media (prefers-reduced-motion: reduce) {
  .km-featured-bell svg {
    animation: none !important;
  }
  .km-featured-ticker-track {
    transition: none !important;
    transform: none !important;
  }
}

/* Sections & Grid List */
.km-section {
  margin-bottom: 22px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.km-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kanal-grup-judul {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--km-text-main);
  text-transform: capitalize;
  letter-spacing: normal;
}

.km-section-more {
  font-size: 12.5px;
  color: var(--km-text-muted);
  cursor: pointer;
}

.km-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Kanal Baris (Card) */
.kanal-baris {
  background-color: var(--km-card-bg);
  border: 1px solid var(--km-card-border);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.kanal-baris:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background-color: var(--km-card-hover);
}

.kanal-baris .ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--km-text-sub);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.kanal-baris .ava img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 2;
}

.kanal-baris .ava img.is-hidden {
  display: none !important;
}

.ava-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-radius: 50%;
  z-index: 1;
  user-select: none;
}

.kanal-baris .isi {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kanal-baris .nama {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--km-text-main);
  margin-bottom: 2px;
}

.kanal-baris .nama .t {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.kanal-baris .nama svg {
  color: var(--km-blue);
  flex-shrink: 0;
}

.kanal-baris .desc {
  font-size: 11.5px;
  color: var(--km-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.kanal-baris .aksi {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  min-height: 32px;
  background-color: var(--km-green);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

.btn-wa:hover {
  opacity: 0.9;
}

.btn-salin-kecil {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--km-card-border);
  color: var(--km-text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-salin-kecil:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--km-text-main);
}

/* =========================================================
   MOBILE HEADER & DRAWER (~85vw)
   ========================================================= */
.community-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: auto;
  min-height: calc(52px + env(safe-area-inset-top, 0px));
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-bottom: 6px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  background-color: var(--km-sidebar-bg);
  border-bottom: 1px solid var(--km-card-border);
  box-sizing: border-box;
  z-index: 30;
  width: 100%;
  max-width: 100%;
}

.community-mobile-header-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-hamburger {
  background: none;
  border: none;
  color: var(--km-text-main);
  padding: 8px;
  width: 44px;
  height: 44px;
  min-width: var(--km-touch-min);
  min-height: var(--km-touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.community-mobile-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--km-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-mobile-title img {
  height: 24px;
  width: 24px;
  display: block;
}

.btn-bell-mobile {
  background: none;
  border: none;
  color: var(--km-text-main);
  width: 44px;
  height: 44px;
  min-width: var(--km-touch-min);
  min-height: var(--km-touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.km-bell-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #0f131c;
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.community-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 85vw;
  max-width: 320px;
  background-color: var(--km-sidebar-bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.community-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.btn-drawer-close {
  background: none;
  border: none;
  color: var(--km-text-sub);
  width: 44px;
  height: 44px;
  min-width: var(--km-touch-min);
  min-height: var(--km-touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}

/* =========================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================= */
@media (max-width: 768px) {
  .community-sidebar {
    display: none;
  }

  .community-mobile-header {
    display: flex;
    flex-shrink: 0;
  }

  .community-main {
    height: 100%;
    min-height: 0;
    flex: 1;
  }

  .community-main.km-main-room {
    overflow: hidden;
    height: 100%;
    min-height: 0;
  }

  .community-scroll-wrap {
    flex: 1;
    min-height: 0;
    padding: 12px 12px calc(72px + env(safe-area-inset-bottom)) 12px;
  }

  .community-scroll-wrap.km-scroll-wrap-room {
    padding: 0;
    margin: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    height: 100%;
  }

  /* Security Notice: Compact Single-Row / Two-Row Notice */
  .km-security-card {
    padding: 8px 12px;
    gap: 8px;
    margin-bottom: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
  }

  .km-security-card > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .km-security-info strong {
    font-size: 11.5px;
    line-height: 1.25;
    margin-bottom: 0;
  }

  .km-security-info p {
    display: none;
  }

  .w-hitung {
    font-size: 10px;
    padding: 2px 7px;
    margin-left: auto;
  }

  .km-filter-bar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .km-search-input {
    height: 40px;
    font-size: 13px;
  }

  .km-pills {
    gap: 6px;
  }

  .km-pill {
    padding: 5px 12px;
    min-height: 32px;
    font-size: 12px;
  }

  /* Featured Room Mobile Refinement */
  .km-featured-room {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
  }

  .km-featured-head {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
  }

  .km-featured-ava {
    width: 44px;
    height: 44px;
  }

  .km-featured-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
  }

  .km-featured-name {
    min-width: 0;
    white-space: nowrap;
    font-size: clamp(10px, 3.1vw, 12px);
    display: flex;
    gap: 3px;
    align-items: center;
  }

  .km-featured-bell {
    font-size: clamp(8px, 2.4vw, 9px);
    padding: 3px 6px;
    gap: 3px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .km-featured-desc {
    font-size: 10.5px;
  }

  .km-featured-meta-row {
    margin: 10px 0 8px;
    font-size: 11px;
    gap: 6px;
  }

  .km-featured-cta {
    height: 44px;
    font-size: 14px;
    margin-top: 8px;
  }

  .km-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kanal-baris {
    padding: 10px 12px;
    gap: 10px;
  }

  .kanal-baris .ava {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }

  .drawer-header .community-brand img {
    height: 26px;
    width: auto;
    max-width: 175px;
  }
}

/* =========================================================
   EMPTY STATE & PROFILE CARDS
   ========================================================= */
.km-empty-card {
  background-color: var(--km-card-bg);
  border: 1px solid var(--km-card-border);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  box-sizing: border-box;
}

.km-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.km-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--km-text-main);
  margin-bottom: 6px;
}

.km-empty-desc {
  font-size: 13px;
  color: var(--km-text-sub);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
}

.km-profile-card {
  background-color: var(--km-card-bg);
  border: 1px solid var(--km-card-border);
  border-radius: 14px;
  padding: 24px;
  box-sizing: border-box;
}

.km-profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--km-card-border);
  margin-bottom: 20px;
}

.km-profile-ava {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3447 0%, #1e2638 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid var(--km-card-border);
  flex-shrink: 0;
}

.km-profile-info {
  flex: 1;
}

.km-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--km-text-main);
  margin: 0 0 2px 0;
}

.km-profile-handle {
  font-size: 13px;
  color: var(--km-text-muted);
  display: block;
  margin-bottom: 8px;
}

.km-profile-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.km-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--km-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.km-role-badge.km-role-official {
  background-color: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.km-official-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 0;
  flex-shrink: 0;
  line-height: 1;
}

.km-official-badge svg,
.km-official-badge img,
.km-official-badge-icon {
  display: block;
  flex-shrink: 0;
}

.km-profile-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.km-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
}

.km-profile-label {
  color: var(--km-text-muted);
}

.km-profile-val {
  color: var(--km-text-main);
  font-weight: 500;
}

.text-success {
  color: var(--km-green) !important;
}

/* ==========================================================================
   Avatar Manajemen Komunitas & Pratinjau Crop / Zoom
   ========================================================================== */

.km-profile-ava-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.km-profile-ava {
  position: relative;
  overflow: hidden;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3447 0%, #1e2638 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.km-profile-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.km-profile-ava-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.km-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.km-avatar-btn:focus-visible {
  outline: 2px solid var(--km-orange);
  outline-offset: 2px;
}

.km-avatar-btn-primary {
  background: var(--km-orange);
  color: #ffffff;
}

.km-avatar-btn-primary:hover {
  background: #e65c00;
  transform: translateY(-1px);
}

.km-avatar-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.km-avatar-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

/* Feedback Status Alert */
.km-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.km-alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.km-alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.km-alert-loading {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Modal Crop & Zoom */
.km-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.km-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.km-crop-dialog {
  position: relative;
  background: #171f2c;
  border: 1px solid var(--km-card-border);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.km-crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--km-card-border);
}

.km-crop-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--km-text-main);
  margin: 0;
}

.km-crop-close {
  background: none;
  border: none;
  color: var(--km-text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.km-crop-close:hover {
  color: #fff;
}

.km-crop-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.km-crop-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 12px;
  background: #0f141e;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.km-crop-viewport:active {
  cursor: grabbing;
}

.km-crop-viewport canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.km-crop-circle-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(15, 20, 30, 0.7);
  border: 2px dashed rgba(255, 107, 0, 0.75);
}

.km-crop-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.km-crop-label {
  font-size: 12px;
  color: var(--km-text-muted);
  font-weight: 500;
}

.km-crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.km-zoom-icon {
  font-size: 16px;
  color: var(--km-text-muted);
  font-weight: 700;
}

.km-crop-zoom-row input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #242d3d;
  outline: none;
  accent-color: var(--km-orange);
}

.km-crop-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--km-card-border);
  background: #141b27;
}

.km-crop-btn-cancel,
.km-crop-btn-save {
  flex: 1;
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.km-crop-btn-cancel {
  background: transparent;
  color: var(--km-text-muted);
  border: 1px solid var(--km-card-border);
}

.km-crop-btn-cancel:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.km-crop-btn-save {
  background: var(--km-orange);
  color: #fff;
  border: none;
}

.km-crop-btn-save:hover {
  background: #e65c00;
}

.km-crop-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 500px) {
  .km-profile-header {
    flex-direction: column;
    text-align: center;
  }
  .km-profile-badge-row {
    justify-content: center;
  }
}

/* =========================================================
   Bottom Navigation Bar (Mobile HP) — Tema Terpadu JagoTopup
   Kontrak dimensi & safe-area diselaraskan dengan tema-2026.css
   (touch target >= 44px, padding safe-area-inset-bottom dinamis)
   ========================================================= */
.bnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(11, 14, 20, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--km-card-border);
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .bnav {
    display: none !important;
  }
}

body.drawer-open .bnav {
  display: none !important;
}

.bnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--km-text-muted);
  position: relative;
  flex: 1;
  max-width: 90px;
  min-height: 44px;
  text-decoration: none;
  padding: 2px 0;
  box-sizing: border-box;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.bnav a:hover,
.bnav a.on {
  color: var(--km-orange);
}

.bnav svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.bnav .tj-dot-baru {
  position: absolute;
  top: 2px;
  right: calc(50% - 14px);
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--km-orange);
  box-shadow: 0 0 0 2px var(--km-bg);
}

/* ==========================================================================
   Web Push Notifications & Dual Controls (Fase 2026-09-29)
   ========================================================================== */
.km-push-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(30, 58, 138, 0.25);
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  padding: 10px 16px;
  box-sizing: border-box;
}
.km-push-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.km-push-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  flex-shrink: 0;
}
.km-push-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.km-push-banner-text strong {
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 600;
}
.km-push-banner-text span {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.km-push-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.km-btn-banner-optin {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.km-btn-banner-optin:hover {
  background: #1d4ed8;
}
.km-btn-banner-dismiss {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
}
.km-btn-banner-dismiss:hover {
  color: #cbd5e1;
}

/* Modal Pengaturan Notifikasi */
.km-notif-settings-modal {
  max-width: 440px;
  width: 90%;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 20px;
  color: #e2e8f0;
  box-sizing: border-box;
}
.km-notif-controls-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
.km-notif-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  cursor: pointer;
}
.km-notif-control-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.km-notif-control-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
}
.km-notif-control-desc {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

/* Toggle Switch */
.km-switch-wrapper {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.km-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.km-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: 0.2s ease;
  border-radius: 24px;
}
.km-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
}
.km-toggle-input:checked + .km-toggle-slider {
  background-color: #2563eb;
}
.km-toggle-input:checked + .km-toggle-slider:before {
  transform: translateX(20px);
}
.km-toggle-input:disabled + .km-toggle-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* iOS PWA Guide */
.km-ios-pwa-guide {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.km-ios-guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #93c5fd;
}
.km-ios-guide-steps {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Status Alert */
.km-push-status-notice {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.km-notice-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
.km-notice-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}
.km-notice-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.km-notice-info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}



