/* OnlyShows 0.11.2: true bottom-up ordering, fading content edge and expandable database dock. */

.profile-summary {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}

.profile-summary > img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-container-highest);
}

.profile-summary > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.profile-summary small {
  color: var(--on-surface-variant);
  font-size: 11px;
  font-weight: 700;
}

.profile-summary strong {
  overflow: hidden;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary > button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 13px;
  font-weight: 750;
}

.profile-summary > button .material-symbols-rounded {
  font-size: 18px;
}

.profile-edit-dialog {
  width: min(620px, calc(100vw - 48px));
}

.profile-edit-fields {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 24px 0;
}

.profile-edit-fields > img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-container-highest);
}

.profile-edit-fields label {
  display: grid;
  gap: 8px;
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 750;
}

.profile-edit-fields input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid var(--outline-variant);
  border-radius: 16px;
  outline: 0;
  background: var(--surface-container-low);
  color: var(--on-surface);
  font-size: 17px;
  font-weight: 700;
}

.profile-edit-fields input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent);
}

.profile-edit-avatars {
  padding: 22px 0;
  border-top: 1px solid var(--outline-variant);
}

.profile-edit-avatars h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.profile-edit-save {
  width: 100%;
  margin: 0 0 24px;
}

@media (max-width: 719px) {
  .library {
    padding-bottom: 0 !important;
  }

  body.mobile-database-tab .library {
    padding-bottom: 0 !important;
  }

  body:not(.mobile-profile-tab) .library::after {
    content: "";
    position: fixed;
    z-index: 1170;
    right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 0;
    height: 150px;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      color-mix(in srgb, var(--surface) 12%, transparent) 34%,
      color-mix(in srgb, var(--surface) 58%, transparent) 72%,
      color-mix(in srgb, var(--surface) 88%, transparent) 100%
    );
  }

  body.mobile-database-tab #mobileWorkspaceDock {
    right: 12px !important;
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    left: 12px !important;
    width: auto !important;
  }

  body.mobile-database-tab .mobile-database-actions {
    border-bottom: 0 !important;
    border-radius: 24px 24px 0 0 !important;
    background: var(--surface-container-high) !important;
    box-shadow: 0 -8px 22px rgb(0 0 0 / 12%) !important;
    transform-origin: bottom center;
    animation: database-dock-expand 260ms cubic-bezier(.2, .8, .2, 1) both;
  }

  html body .mobile-bottom-nav {
    transition: border-radius 240ms ease, box-shadow 240ms ease !important;
  }

  html body.mobile-database-tab .mobile-bottom-nav {
    border-top-color: transparent !important;
    border-radius: 0 0 21px 21px !important;
    box-shadow: 0 10px 26px rgb(0 0 0 / 18%) !important;
  }

  .profile-summary {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 18px 0 20px;
  }

  .profile-summary > img {
    width: 72px;
    height: 72px;
  }

  .profile-summary strong {
    font-size: 19px;
  }

  .profile-summary > button {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  .profile-summary > button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .profile-edit-dialog[open] {
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 18px calc(24px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important;
    background: var(--surface) !important;
  }

  .profile-edit-dialog .insights-scroll {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .profile-edit-fields {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 15px;
    padding: 24px 0 18px;
  }

  .profile-edit-fields > img {
    width: 82px;
    height: 82px;
  }

  .profile-edit-dialog .avatar-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes database-dock-expand {
  from {
    opacity: 0;
    transform: translateY(22px) scaleX(.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.mobile-database-tab .mobile-database-actions {
    animation: none !important;
  }
}
