/*
 * Small, intentionally unminified refinements kept separate from the
 * generated stylesheet so visual fixes remain easy to review and cache.
 */

/* Never blank the whole page when an optional script fails to load. */
body,
body.loaded {
  opacity: 1;
  transition: none;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

*:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 78%, #fff);
  outline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.navbar-inner {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.nav-user-btn,
.theme-toggle,
.menu-toggle {
  min-width: 44px;
  min-height: 44px;
}

.nav-user-btn {
  gap: 0.35rem;
}

.search-form input {
  min-height: 42px;
}

.article-content,
.detail-content,
.file-description,
.about-section {
  overflow-wrap: anywhere;
}

.article-content pre,
.article-content table,
.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.article-content pre {
  -webkit-overflow-scrolling: touch;
}

.preview-locked {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem 1rem;
}

.preview-locked .icon {
  font-size: 2.25rem;
}

.like-label {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .navbar-inner {
    gap: 0.5rem;
  }

  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .navbar-inner {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .logo {
    font-size: 1.05rem;
  }

  .file-preview-header {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .file-preview-header > span {
    margin-left: 0 !important;
  }
}

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

