.floating-chapters{position:fixed;z-index:8;right:9px;top:50%;transform:translateY(-50%);width:107px;color:#333a31;background:#f5f4ebd9;border:1px solid #555a4420;border-radius:14px;padding:12px 5px;backdrop-filter:blur(14px);box-shadow:0 5px 25px #20251b08}.rail-label{font:8px/1.5 'DM Sans',Arial,sans-serif;letter-spacing:.14em;margin:0 0 9px;text-align:center;color:#6c7267}.rail-links{display:flex;flex-direction:column;gap:2px}.rail-links a{display:flex;align-items:center;gap:7px;min-height:30px;padding:4px 5px;box-sizing:border-box;border-radius:6px;text-decoration:none;color:inherit;opacity:.6;font:10px/1.2 'DM Sans',Arial,sans-serif}.rail-links a b{font:9px/1.2 monospace;font-weight:400;width:14px;flex:none}.rail-links a[aria-current]{opacity:1;background:#343d31;color:#fff}.rail-links a:hover,.rail-links a:focus-visible{opacity:1;outline:1px solid #69785a;outline-offset:1px}.project-select button{display:flex!important;flex-direction:column;align-items:flex-start;gap:10px;flex:1;min-width:0;text-align:left}.project-select{gap:18px!important;align-items:flex-start}.project-select .project-thumb{width:100%;height:clamp(68px,8vw,115px);object-fit:cover;border-radius:2px;opacity:.65;filter:saturate(.65);transition:opacity .3s,filter .3s}.project-select button[aria-pressed=true] .project-thumb,.project-select button:hover .project-thumb{opacity:1;filter:none}.project-select button span{font-size:inherit}.project-select button[aria-pressed=true]{border-color:currentColor}
@media(min-width:701px) and (max-width:1279px){.floating-chapters{width:34px;right:7px;padding:10px 3px}.rail-label{font-size:6px;letter-spacing:.02em}.rail-links a{justify-content:center;padding:5px 0;min-height:29px}.rail-links a b{width:auto}.rail-links a span{position:absolute;right:43px;padding:9px 12px;background:#f3f3ee;white-space:nowrap;border:1px solid #535b3f33;border-radius:5px;opacity:0;pointer-events:none}.rail-links a:hover span,.rail-links a:focus-visible span{opacity:1}}
@media(max-width:700px){.project-select{gap:10px!important}.project-select .project-thumb{height:62px}.project-select button{gap:7px;font-size:10px!important;line-height:1.3}.project-select button span{font-size:10px}.project-select button{padding-bottom:9px!important}}
@media(max-height:560px) and (min-width:701px){.floating-chapters{max-height:70dvh;overflow:auto}.rail-links a{min-height:23px}.rail-label{margin-bottom:4px}}
@media(prefers-reduced-motion:reduce){.project-thumb{transition:none!important}}


@media (max-width: 700px), (max-width: 1000px) and (orientation: landscape) and (pointer: coarse) {
  :root {
    --chapter-safe-bottom: env(safe-area-inset-bottom, 0px);
    --chapter-bar-height: calc(57px + var(--chapter-safe-bottom));
    scroll-padding-bottom: var(--chapter-bar-height);
  }

  body { padding-bottom: var(--chapter-bar-height); }

  .floating-chapters {
    inset: auto 0 0;
    width: auto;
    max-height: none;
    transform: none;
    padding: 6px 0 calc(6px + var(--chapter-safe-bottom));
    border: 0;
    border-top: 1px solid #555a4433;
    border-radius: 0;
    overflow: visible;
    background: #f5f4eb;
    box-shadow: 0 -4px 22px #20251b12;
  }

  .rail-label { display: none; }

  .rail-links {
    flex-direction: row;
    gap: 5px;
    margin-right: calc(48px + env(safe-area-inset-right, 0px));
    padding-inline: max(12px, env(safe-area-inset-left, 0px)) 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .rail-links::-webkit-scrollbar { display: none; }

  .rail-links a {
    flex: none;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 22px;
    white-space: nowrap;
    font-size: 13px;
    opacity: .85;
  }

  .rail-links a b { width: auto; }
  .rail-links a span {
    position: static;
    padding: 0;
    opacity: 1;
    background: none;
    border: 0;
  }

  .rail-links a:focus-visible { outline: 2px solid #69785a; outline-offset: -2px; }
  .rail-links a:not(:focus-visible):hover { outline: none; }

  .motion {
    left: auto;
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: calc(11px + var(--chapter-safe-bottom));
    width: 36px;
    height: 34px;
    padding: 0;
  }

  .motion span { display: none; }
  .story-next { bottom: calc(var(--chapter-bar-height) + 12px); }
}