/* TumTumPá V14.2 — correções mobile/PWA sobre o layout existente. */

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  transform: translateY(-160%);
  border-radius: 8px;
  background: #100622;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.home-publisher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 13px;
  background: var(--bg-card);
  border-block: 1px solid var(--border);
}
.home-publisher-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ece7f5;
  color: #3c2070;
  font-size: 15px;
  font-weight: 900;
}
.home-publisher-open {
  min-height: 44px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-sec);
  padding: 9px 14px;
  text-align: left;
  font-size: 14px;
}
.home-publisher-media {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  background: #eeedfe;
  color: var(--purple);
  font-size: 18px;
}

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
  padding: 12px 10px;
  background: var(--bg-card);
  border-block: 1px solid var(--border);
}
.home-shortcut {
  min-width: 0;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}
.home-shortcut i { color: var(--purple); font-size: 20px; }

.home-network-state,
.home-loading-state,
.home-error-state,
.real-empty-home {
  margin: 7px 10px 0;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.home-network-state {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid #d6a700;
  background: #fff7cf;
  color: #5f4700;
  font-weight: 800;
}
.home-network-state.visible { display: flex; }
.home-loading-state {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  color: var(--text-sec);
}
.home-loading-state[hidden], .home-error-state[hidden] { display: none; }
.home-loading-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #ded8f2;
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: ttp-spin .8s linear infinite;
}
@keyframes ttp-spin { to { transform: rotate(360deg); } }
.home-error-state {
  border: 1px solid #dc3545;
  background: #fff1f2;
  color: #7f1d1d;
}
.home-error-state button {
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 9px;
  background: var(--purple);
  color: #fff;
  padding: 8px 12px;
  font-weight: 800;
}
.home-feed-heading {
  margin: 12px 13px 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 900;
}
.home-occasional { display: contents; }
.home-occasional-card {
  margin-top: 6px;
  padding: 12px 13px;
  border-block: 1px solid var(--border);
  background: var(--bg-card);
}
.home-occasional-card strong { display: block; font-size: 14px; }
.home-occasional-card span { display: block; margin-top: 4px; color: var(--text-sec); font-size: 12px; }
.home-occasional-card button { min-height: 44px; margin-top: 8px; }

.notif-permission-card {
  margin: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}
.notif-permission-card strong,
.notif-permission-card span { display: block; }
.notif-permission-card strong { font-size: 14px; }
.notif-permission-card span { margin-top: 4px; color: var(--text-sec); font-size: 12px; line-height: 1.4; }
.notif-permission-card button {
  min-height: 44px;
  margin-top: 9px;
  border: 0;
  border-radius: 9px;
  background: var(--purple);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}
.notif-permission-status { margin-top: 7px; font-size: 12px; }
.notif-list .notif-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  text-align: left;
}

.chat-tools { display: flex; align-items: center; gap: 4px; }
.chat-tools button,
.chat-call-actions button,
.chat-composer > button,
.chat-back { min-width: 44px; min-height: 44px; }
.chat-search-row {
  display: flex;
  gap: 7px;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.chat-search-row[hidden] { display: none; }
.chat-search-row input {
  min-height: 44px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
}
.chat-typing {
  min-height: 20px;
  padding: 2px 12px;
  color: var(--text-sec);
  font-size: 12px;
}
.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-left: 3px solid var(--purple);
  background: #f3f0ff;
  color: #2d1c4b;
  font-size: 12px;
}
.chat-reply-bar[hidden] { display: none; }
.chat-reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-bar button { width: 44px; height: 44px; border: 0; background: transparent; }
.msg-reply-preview {
  margin-bottom: 5px;
  padding: 5px 7px;
  border-left: 3px solid currentColor;
  border-radius: 4px;
  background: rgba(255,255,255,.16);
  font-size: 11px;
  opacity: .85;
}
.msg-actions { display: flex; gap: 2px; margin-top: 2px; }
.msg-actions button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-sec);
}
.msg-row[hidden] { display: none; }

.call-btn { min-width: 52px; min-height: 52px; }

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

@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select { font-size: 16px !important; }

  button,
  [role="button"],
  .ni,
  .sitem { min-height: 44px; }

  .ni,
  .mini-player-btns button,
  .mini-close { min-width: 44px; }

  .mini-copy,
  .mini-sub,
  .csub,
  .chat-sub,
  .notif-item-sub,
  .thread-last,
  .thread-meta { font-size: 12px !important; }

  .phone .tuca-float {
    top: auto !important;
    right: max(8px, var(--safe-right)) !important;
    bottom: calc(76px + var(--safe-bottom)) !important;
    left: auto !important;
    width: 54px;
    height: 54px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    opacity: .92;
  }
  .phone .tuca-float span { display: none; }
  .phone.has-mini-player .tuca-float { bottom: calc(132px + var(--safe-bottom)) !important; }
  body.keyboard-open .tuca-float { display: none !important; }
  .scroll { padding-bottom: calc(84px + var(--safe-bottom)); }
}

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