


















:root {
   
  --nav-w: min(320px, 86vw);
  --nav-z: 1500;
  --nav-slide: 0.22s;
}

 
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;  
  height: 44px;
  margin-left: -8px;  
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}














.header:not(:has(.dot.connected)) .nav-toggle {
  opacity: .4;
  cursor: not-allowed;
}

 
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--nav-z);
  background: var(--scrim);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--nav-slide) ease,
    visibility 0s linear var(--nav-slide);
}
body.nav-open .nav-scrim {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--nav-slide) ease;
}

 
.nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: calc(var(--nav-z) + 1);
  display: flex;
  flex-direction: column;
  width: var(--nav-w);
  

  padding: 20px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 40px var(--shadow-drawer);
  transform: translateX(-100%);
  visibility: hidden;
  transition:
    transform var(--nav-slide) ease,
    visibility 0s linear var(--nav-slide);
}
body.nav-open .nav-drawer {
  transform: none;
  visibility: visible;
  transition: transform var(--nav-slide) ease;
}
.nav-drawer:focus {
  outline: none;  
}





.nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px;
}












.nav-head {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--line);
}


.nav-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-brand-slot {
  display: flex;
  align-items: center;
  min-width: 0;       
}


.nav-dot-slot {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}






.nav-connect-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
}






.nav-empty {
  display: none;
   
  flex: 1;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 0 18px;
  text-align: center;
}
.nav-empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}








.nav-reader-slot {
  display: none;
  flex: 0 0 auto;       
  align-items: center;
  justify-content: center;
  padding: 10px 14px 0;
  border-top: 1px solid var(--line);    
}






.nav-section + .nav-section {
  margin-top: 10px;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-align: left;
  cursor: pointer;
}
.nav-section-toggle::before {
  content: "▾";  
  color: var(--muted);
  font-size: 0.7rem;
}
.nav-section-toggle[aria-expanded="false"]::before {
  content: "▸";
}
.nav-section-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}




.nav-section-toggle[aria-expanded="false"] + .nav-section-body {
  display: none;
}

.nav-section-body {
  padding-left: 6px;  
}





.nav-theme {
  display: flex;
  gap: 6px;
  padding: 2px 12px 8px;
}
.nav-theme-btn {
  flex: 1;
  padding: 8px 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
}
.nav-theme-btn[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: var(--on-green);
  font-weight: 600;
}
.nav-theme-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}




.nav-commands {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 12px 8px;
}
.nav-commands .suggestion-btn {
  width: 100%;
  justify-content: flex-start;
}




.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list li + li {
  margin-top: 2px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.nav-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}










.nav-book-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
















.nav-book-row {
  position: relative;  
}
.nav-book-row + .nav-book-row::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--line);  
  pointer-events: none;
}




body.nav-open .chat-messages {
  overflow: hidden;
}





.nav-voice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 10px;
  cursor: pointer;  
}
.nav-voice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;  
}
.nav-voice-label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}


.nav-voice-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}




.nav-voice-switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-voice-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.nav-voice-switch[aria-checked="true"] {
  border-color: var(--green);
  background: var(--green);
}
.nav-voice-switch[aria-checked="true"]::after {
  background: var(--on-green);
  transform: translateX(20px);
}
.nav-voice-switch:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
