diff --git a/.jules/palette.md b/.jules/palette.md
index 9a12c9d..f206232 100644
--- a/.jules/palette.md
+++ b/.jules/palette.md
@@ -48,3 +48,6 @@
## 2024-08-01 - 네이티브 브라우저 UI의 다크 모드 지원 강제
**학습:** CSS 미디어 쿼리(`@media (prefers-color-scheme: dark)`)를 통해 다크 모드를 지원하더라도, 브라우저의 네이티브 UI 요소(스크롤바, 기본 폼 컨트롤, 기본 백그라운드 등)는 테마 변경을 인식하지 못해 어두운 테마 환경에서 밝은 스크롤바가 표시되는 등 시각적 불일치를 초래합니다.
**조치:** 항상 HTML 문서의 `
` 영역에 `` 메타 태그를 명시적으로 추가하여 브라우저 수준에서 사용자의 시스템 테마(다크 모드 등)를 완전히 상속받아 일관성 있는 네이티브 UI를 렌더링하도록 보장하십시오.
+## 2026-07-17 - Fallback for Empty Root Directory Name
+**Learning:** When navigating to the filesystem root, the directory name evaluates to an empty string, which results in empty and
elements. This creates a severe accessibility issue where screen readers cannot announce the page context.
+**Action:** Always provide a fallback (like absolutePath) when dealing with directory names that might evaluate to empty strings to preserve a11y semantic names.
diff --git a/src/main/kotlin/html4tree/main.kt b/src/main/kotlin/html4tree/main.kt
index b455862..5b21876 100644
--- a/src/main/kotlin/html4tree/main.kt
+++ b/src/main/kotlin/html4tree/main.kt
@@ -317,6 +317,9 @@ fun process_dir(curr_dir: File, excludeSet: Set? = null, dirFiles: Array
${cssContent}
"""
+ val dirNameRaw = curr_dir.getName()
+ val dirName = if (dirNameRaw.isEmpty()) curr_dir.getAbsolutePath() else dirNameRaw
+
val index_top = """
@@ -327,12 +330,12 @@ ${cssContent}
- ${curr_dir.getName().escapeHtml()}
+ ${dirName.escapeHtml()}
${css}
-