/* RedFeed Hub — gatilho exclusivo + bottom sheet (substitui hambúrguer genérico) */
.rf-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.rf-header-actions .rf-notif-btn {
  display: inline-flex !important;
}

/* Idioma/tema só no Hub — nunca na barra superior */
.rf-header-quick-desktop {
  display: none !important;
}

.rf-header-actions .rf-hub-trigger {
  display: inline-flex !important;
}

body.rf-desktop-ui .rf-header-quick-desktop {
  display: none !important;
}

body.rf-desktop-ui .rf-header-actions .rf-hub-trigger {
  display: inline-flex !important;
}

/* —— Gatilho: orbe RedFeed (4 pontos em losango, não hambúrguer) —— */
.rf-hub-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.rf-hub-trigger-core {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, background 0.22s ease;
}

.rf-hub-trigger-glow {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  opacity: 0.35;
  animation: rfHubPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes rfHubPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.28; }
  50% { transform: scale(1.04); opacity: 0.48; }
}

.rf-hub-dots {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 5px;
  transform: rotate(45deg);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), gap 0.28s ease;
}

.rf-hub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
}

.rf-hub-trigger[aria-expanded="true"] .rf-hub-trigger-core {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.rf-hub-trigger[aria-expanded="true"] .rf-hub-dots {
  transform: rotate(0deg);
  gap: 4px;
}

.rf-hub-trigger[aria-expanded="true"] .rf-hub-trigger-glow {
  animation: none;
  opacity: 0.85;
  transform: scale(1.12);
}

/* —— Bottom sheet —— */
.rf-hub-sheet {
  position: fixed;
  inset: 0;
  z-index: 2147482050;
  display: none;
  pointer-events: none;
}

.rf-hub-sheet.on {
  display: block;
  pointer-events: auto;
}

.rf-hub-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.rf-hub-sheet.on .rf-hub-backdrop {
  opacity: 1;
}

.rf-hub-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1c1424 0%, #0a0a10 100%);
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  box-shadow: 0 -28px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(105%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.rf-hub-sheet.on .rf-hub-panel {
  transform: translateY(0);
}

.rf-hub-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0.7;
}

html[data-rf-theme="light"] .rf-hub-panel {
  background: linear-gradient(180deg, #fff 0%, #f4f4f8 100%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.14);
}

.rf-hub-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 10px auto 6px;
  flex-shrink: 0;
}

html[data-rf-theme="light"] .rf-hub-handle {
  background: rgba(0, 0, 0, 0.12);
}

.rf-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 18px 12px;
  flex-shrink: 0;
}

.rf-hub-head-text h2 {
  margin: 0;
  font-family: var(--rf-title, "Space Grotesk", sans-serif);
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.rf-hub-head-text p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.68;
  line-height: 1.35;
}

.rf-hub-close {
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

html[data-rf-theme="light"] .rf-hub-close {
  background: rgba(0, 0, 0, 0.06);
}

.rf-hub-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 14px 12px;
  padding: 12px 14px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rf-hub-user img,
.rf-hub-user-fallback {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.16);
}

.rf-hub-user-fallback {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1rem;
}

.rf-hub-user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rf-hub-user-text strong {
  font-size: 0.92rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rf-hub-user-text small {
  font-size: 0.74rem;
  opacity: 0.72;
  font-weight: 600;
}

.rf-hub-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 8px;
  -webkit-overflow-scrolling: touch;
}

.rf-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rf-hub-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 12px 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transform: translateY(14px);
}

.rf-hub-sheet.on .rf-hub-tile {
  animation: rfHubTileIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rf-hub-sheet.on .rf-hub-tile:nth-child(1) { animation-delay: 0.04s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(2) { animation-delay: 0.07s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(3) { animation-delay: 0.1s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(4) { animation-delay: 0.13s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(5) { animation-delay: 0.16s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(6) { animation-delay: 0.19s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(7) { animation-delay: 0.22s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(8) { animation-delay: 0.25s; }
.rf-hub-sheet.on .rf-hub-tile:nth-child(9) { animation-delay: 0.28s; }

@keyframes rfHubTileIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rf-hub-tile:active {
  transform: scale(0.96);
}

.rf-hub-tile:hover,
.rf-hub-tile:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  outline: none;
}

html[data-rf-theme="light"] .rf-hub-tile {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.rf-hub-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

.rf-hub-tile.is-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 56px;
  justify-content: flex-start;
  gap: 14px;
  padding: 14px 16px;
  text-align: left;
}

.rf-hub-tile.is-wide .rf-hub-tile-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.rf-hub-tile.is-primary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.rf-hub-tile.is-primary .rf-hub-tile-icon {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.rf-hub-tile.is-danger .rf-hub-tile-icon {
  background: rgba(255, 80, 120, 0.15);
  color: #ff6b8a;
}

.rf-hub-tile-label {
  line-height: 1.2;
}

.rf-hub-tile-meta {
  font-size: 0.62rem;
  opacity: 0.62;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.rf-hub-tile.is-wide .rf-hub-tile-meta {
  margin-left: auto;
  padding: 0;
  background: transparent;
  font-size: 0.68rem;
}

.rf-hub-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 18px 4px;
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.68;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-rf-theme="light"] .rf-hub-foot {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.rf-hub-foot a {
  color: inherit;
  text-decoration: none;
}

.rf-hub-foot a:hover {
  opacity: 1;
  color: inherit;
}

html[data-rf-theme="light"] .rf-hub-trigger-core {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

html[data-rf-theme="light"] .rf-hub-dot {
  background: rgba(20, 20, 28, 0.78);
}

html[data-rf-theme="light"] .rf-hub-tile-icon {
  color: #3a3a48;
}

body.rf-hub-open {
  overflow: hidden;
  touch-action: none;
}

@media (min-width: 760px) {
  .rf-hub-sheet.on {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
  }

  .rf-hub-panel {
    position: relative;
    width: min(440px, 100%);
    border-radius: 24px;
    max-height: min(78dvh, 640px);
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  }

  .rf-hub-sheet.on .rf-hub-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .rf-hub-handle {
    display: none;
  }
}
