.back-to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff38; border-radius: 50%; background: #202020e6; color: #fff; box-shadow: 0 2px 10px #0002; cursor: pointer; }
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: #111; }
.back-to-top:focus-visible, .viewer-close:focus-visible { outline: 3px solid #ff3b30; outline-offset: 3px; }
.publication-image-link { width: 100%; padding: 0; border: 0; cursor: zoom-in; }
.publication-viewer { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 48px 12px 12px; border: 0; border-radius: 16px; background: #161616; color: white; }
.publication-viewer::backdrop { background: #000d; }
.publication-viewer .publication-image { width: auto; max-width: 100%; max-height: calc(100dvh - 100px); margin: auto; object-fit: contain; }
.viewer-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: white; font-size: 30px; cursor: pointer; }

.mobile-navigation { display: none; }
@media (max-width: 850px) {
  .journal-page .sidebar { position: static; height: auto; min-height: 0; padding: 16px 18px; }
  .journal-page .sidebar nav, .journal-page .sidebar-footer { display: none; }
  .journal-page .main-shell { margin-left: 0; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .journal-page .mobile-navigation { position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; overflow: visible; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #e8e8e5; background: #fff; box-shadow: 0 -4px 20px #00000006; }
  .journal-page .mobile-navigation > a, .mobile-more > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 54px; margin: 0; padding: 5px 0; border: 0; border-radius: 10px; background: transparent; color: #686864; font-size: 10px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
  .journal-page .mobile-navigation > a > span { display: block; width: auto; font-size: 10px; line-height: 1.2; white-space: nowrap; }
  .journal-page .mobile-navigation .nav-symbol { display: block; width: 22px; height: 22px; }
  .journal-page .mobile-navigation a[aria-current="page"] { background: #fff0ee; color: #bf2822; box-shadow: none; }
  .journal-page .mobile-navigation .mobile-feed { color: #bf2822; }
  .mobile-more > summary { list-style: none; }
  .mobile-more > summary::-webkit-details-marker { display: none; }
  .mobile-more[open] > summary { background: #f4f4f2; color: #111; }
  .mobile-more-panel { position: absolute; bottom: calc(100% + 8px); right: 12px; width: min(280px, calc(100vw - 24px)); padding: 8px; border: 1px solid #e8e8e5; border-radius: 16px; background: white; box-shadow: 0 8px 30px #0002; }
  .journal-page .mobile-more-panel a { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 12px; border-radius: 8px; color: #202020; font-size: 14px; white-space: normal; }
  .journal-page .mobile-more-panel a:hover { background: #f4f4f2; color: #111; }
  .journal-page .back-to-top { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

.navigation-loader { position: fixed; inset: 0 0 auto; z-index: 1000; height: 3px; overflow: hidden; pointer-events: none; background: #ff3b3220; }
.navigation-loader[hidden] { display: none; }
.navigation-loader::after { content: ""; display: block; width: 40%; height: 100%; background: #ff3b32; border-radius: 0 3px 3px 0; animation: navigation-progress 1.1s ease-in-out infinite; }
@keyframes navigation-progress { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
@media (prefers-reduced-motion: reduce) { .navigation-loader::after { animation: none; width: 100%; } }

.story-section { margin: 0 0 22px; }
.story-strip { display: flex; gap: 16px; overflow-x: auto; padding: 6px 2px 10px; }
.story-chip { flex: 0 0 76px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 12px; }
.story-chip > span:last-child { display: block; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-ring, .story-add { display: grid; place-items: center; width: 64px; height: 64px; border: 2px solid #ff3b32; border-radius: 50%; padding: 3px; }
.story-ring .user-avatar { width: 54px; height: 54px; }
.story-add { color: #bf2822; font-size: 30px; background: #fff2f0; }
.story-hint { font-size: 13px; color: var(--muted, #aaa); line-height: 1.6; }
.story-form { max-width: 680px; }
.story-form > p { margin-bottom: 14px; line-height: 1.6; }
.story-view { width: min(560px, 100%); margin: auto; border-radius: 18px; background: #161616; color: #fff; padding: 16px; }
.story-view header, .story-view header > a:first-child { display: flex; align-items: center; gap: 12px; }
.story-view header { justify-content: space-between; }
.story-view header a { color: #fff; text-decoration: none; }
.story-close { display: grid; place-items: center; width: 44px; height: 44px; font-size: 30px; }
.story-view > p { margin: 12px 0; font-size: 13px; color: #ccc; }
.story-photo { display: block; width: 100%; max-height: 65dvh; object-fit: contain; border-radius: 10px; }
.story-view .text-button { color: #ff8c80; margin-top: 12px; }
