/* Preserve the desktop navigation; mobile uses a single, explicitly opened menu. */
.nav-menu-toggle { display: none; }
@media (max-width: 1024px) {
  .nav-inner {
    position: relative;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 8px 16px;
    min-height: 64px;
  }
  .nav-logo {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
    white-space: nowrap;
    margin-right: auto;
    flex-shrink: 0;
  }
  .nav-inner > .dark-toggle {
    order: 1;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  .nav-menu-toggle {
    display: inline-flex;
    order: 2;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 8px;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }
  .nav-menu-icon { font: 22px/1 sans-serif; }
  .nav-menu-toggle:focus-visible, .nav-links a:focus-visible {
    outline: 2px solid #ff2d78;
    outline-offset: 3px;
  }
  .nav-inner > .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    padding: 12px 20px 20px;
    background: #f5f0e8;
    border-bottom: 2px solid #6a0dad;
    box-shadow: 0 12px 18px rgba(26,26,26,.1);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
  }
  .nav-bar.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-links > a, .nav-links .nav-universe-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    font-size: 14px;
    letter-spacing: .04em;
    white-space: nowrap;
  }
  .nav-links > a { border-bottom: 1px solid rgba(26,26,26,.1); }
  .nav-links .nav-item { width: 100%; text-align: left; }
  .nav-links .nav-trigger {
    display: block;
    padding: 16px 4px 4px;
    font-size: 12px;
    letter-spacing: .1em;
    opacity: .65;
    cursor: default;
  }
  .nav-links .nav-trigger::after { display: none; }
  .nav-links .nav-dropdown,
  .nav-links .nav-item:hover .nav-dropdown,
  .nav-links .nav-item:focus-within .nav-dropdown {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
    min-width: 0;
    padding: 4px 0 12px;
    transform: none;
    visibility: visible;
    opacity: 1;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .nav-links .nav-u-sub { display: none; }
  .nav-links .nav-u-name { font-size: 13px; }
  .nav-links .nav-universe-link { gap: 8px; }
  .nav-links .nav-universe-link:hover { transform: none; }
  body.dark-mode .nav-inner > .nav-links { background: #0d0d0d; }
  body.dark-mode .nav-links > a { border-bottom-color: #333; }
  body.dark-mode .nav-trigger { color: #ccc; }
  .post-content { min-width: 0; }
  .post-content table { display: block; max-width: 100%; overflow-x: auto; }
}
