/* QuickGigs — mobile shell: fixed nav, keyboard, safe areas */

.tab-bar {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  background: var(--tab-bg, #0b0118);
  border-top: 0.5px solid var(--border, rgba(200, 168, 233, 0.1));
  padding: 8px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  transition: background 0.25s;
}

body.light .tab-bar {
  background: var(--tab-bg, #fff);
  border-top-color: var(--border, #f0eeff);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  justify-content: center;
  min-height: 44px;
}

.tab-icon {
  font-size: 22px;
  color: var(--text-faint, rgba(255, 255, 255, 0.35));
  transition: color 0.15s;
  line-height: 1;
}

.tab-lbl {
  font-size: 10px;
  color: var(--text-faint, rgba(255, 255, 255, 0.35));
  transition: color 0.15s;
  line-height: 1.2;
}

.tab-item.active .tab-icon,
.tab-item.active .tab-lbl {
  color: var(--purple-light, #c8a8e9);
}

body.light .tab-item.active .tab-icon,
body.light .tab-item.active .tab-lbl {
  color: var(--purple, #6b3fa0);
}

body.qg-keyboard-open .tab-bar {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

body {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

body.qg-page-chat {
  padding-bottom: 0;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

@supports (height: 100dvh) {
  body.qg-page-chat {
    height: 100dvh;
  }
}

.qg-page-wrap,
.content {
  max-width: 100%;
  overflow-x: hidden;
}

/* Min tap targets (accessibility) */
.act-btn,
.accept-btn,
.send-btn,
.mode-btn,
.submit-btn {
  min-height: 44px;
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2px solid #c8a8e9;
  outline-offset: 2px;
}

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

/* Stop iOS zoom on focus: inputs under 16px cause page enlarge */
@media (max-width: 768px) {
  input,
  textarea,
  select,
  .modal-input,
  .field-input,
  .search-input,
  .location-filter-input,
  .form-input,
  .qg-custom-input,
  .qg-report-textarea,
  .confirm-box input,
  .confirm-box textarea {
    font-size: 16px !important;
    line-height: 1.35;
  }
}

.qg-keyboard-open .modal-overlay.open {
  align-items: flex-start;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-bottom: 8px;
}
.qg-keyboard-open .modal-overlay.open .modal {
  max-height: calc(var(--qg-vvh, 100dvh) - 16px);
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .hint-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .hint-text {
    line-height: 1.55;
  }
  .nav {
    padding-left: 14px;
    padding-right: 14px;
  }
  .chat-scroll {
    padding-left: 14px;
    padding-right: 14px;
  }
  .task-banner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .bubble {
    max-width: 85%;
  }
  .confirm-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .confirm-overlay.open .confirm-box {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    width: 100%;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .confirm-btns {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .confirm-cancel,
  .confirm-ok {
    width: 100%;
    min-height: 48px;
  }
}

.app-avatar,
.conv-avatar,
.nav-chat-avatar,
.user-avatar {
  background-size: cover;
  background-position: center;
}

.app-avatar.has-photo,
.conv-avatar.has-photo,
.nav-chat-avatar.has-photo,
.user-avatar.has-photo {
  color: transparent;
}
